in reply to List manipulation headache
Depending on your input data, this should be pretty easy to do with a regex.
For instance, if your input file looks exactly like your snippet above, you could probably get away with just putting these two lines in a while loop:
For instance, if your input file looks exactly like your snippet above, you could probably get away with just putting these two lines in a while loop:
s/ wap/, /g; s/, / wap/; # change back the first occurrence on each line
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: List manipulation headache
by atancasis (Sexton) on Feb 13, 2011 at 15:30 UTC | |
by elef (Friar) on Feb 14, 2011 at 14:34 UTC |
In Section
Seekers of Perl Wisdom