Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: how to deal with newline

by NetWallah (Abbot)
on Oct 27, 2013 at 16:38 UTC ( #1059919=note: print w/ replies, xml ) Need Help??


in reply to how to deal with newline

Try this ..

perl -ne '$h{$1}=$2 for /(\w+)="([^"]*)"/g}{print qq($_\t= $h{$_}\n) f +or qw(id name)' myfile.txt id = 437 name = Bob
Internal Quotes will have to be escaped and external quotes changed to be double-quotes for Windows.
But you already knew that....

             When in doubt, mumble; when in trouble, delegate; when in charge, ponder. -- James H. Boren


Comment on Re: how to deal with newline
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2015-03-06 09:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When putting a smiley right before a closing parenthesis, do you:









    Results (160 votes), past polls