Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^6: Regex problem while parsing tagged, hierarchical data

by mk. (Friar)
on Sep 19, 2006 at 13:57 UTC ( #573726=note: print w/ replies, xml ) Need Help??


in reply to Re^5: Regex problem while parsing tagged, hierarchical data
in thread Regex problem while parsing tagged, hierarchical data

perl -pi -e '/1 id="(.*)"/?$ci=$1:s/2>/2 id="$ci">/g' input
(:



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"one who asks a question is a fool for five minutes; one who does not ask a question remains a fool forever."

mk at perl dot org dot br


Comment on Re^6: Regex problem while parsing tagged, hierarchical data
Download Code
Re^7: Regex problem while parsing tagged, hierarchical data
by Mago (Parson) on Sep 19, 2006 at 14:28 UTC
    33 chars !
    perl -pi -e '/l1(\sid=.*)>/?$a=$1:s;l2>;l2$a>;' input


    Mago
    mago@rio.pm.org


Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (16)
As of 2014-07-23 16:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (147 votes), past polls