Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: adding ";" to void elements

by jwkrahn (Monsignor)
on Feb 12, 2008 at 16:34 UTC ( #667609=note: print w/replies, xml ) Need Help??


in reply to adding ";" to void elements

$ echo "a;3 b;2;3 c;5;4 d;6" | perl -pe'y/;//==1&&s/$/;/' a;3; b;2;3 c;5;4 d;6;

Replies are listed 'Best First'.
Re^2: adding ";" to void elements
by reasonablekeith (Deacon) on Feb 12, 2008 at 16:53 UTC
    I went beyond the spec, and padded lines with no semi-colons too...
    perl -e 's^$^";"x(2-y-;--)^e' -p data
    ---
    my name's not Keith, and I'm not reasonable.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2022-10-06 01:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (26 votes). Check out past polls.

    Notices?