Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: How to duplicate lines

by bichonfrise74 (Vicar)
on Mar 04, 2010 at 00:06 UTC ( #826580=note: print w/ replies, xml ) Need Help??

in reply to How to duplicate lines

Something like this?

#!/usr/bin/perl use strict; while (my $line = <DATA>) { print $line; if ( $line =~ /\sip address/ ) { $line =~ s/(\d+.\d+.\d+.)252/${1}100/; print $line; } } __DATA__ ip vrf forwarding ABC:Defgh ip address ip vrf forwarding ABD: Efghi ip address

Comment on Re: How to duplicate lines
Download Code
Replies are listed 'Best First'.
Re^2: How to duplicate lines
by ddrew78 (Sexton) on Mar 05, 2010 at 13:13 UTC
    Great, thank you so much. That did the trick.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://826580]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2015-11-28 22:26 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (746 votes), past polls