"be consistent" | |
PerlMonks |
Delete from string through s///by ellem (Hermit) |
on Aug 26, 2004 at 19:32 UTC ( [id://386141]=perlquestion: print w/replies, xml ) | Need Help?? |
ellem has asked for the wisdom of the Perl Monks concerning the following question:
I have a large iTunes XML file that I would like to change. An example is: <key>Album</key><string>1963 - The Lightning Fingers of Roy Clark</string>
I would like to remove "1963 - " or "#### - " for all the instances (about 3658) of this.
I am trying various versions of s/(<key>Album<\/key><string>)\d+\s*-\s*/$1/ ; without much luck. So the idea to me is open a file, identify the proper string and delete the offending "nnnn - " in some loop until there are no more to do and close the file. Maybe print some cheery - you're done now! type message. Ideas, man/web pages, modules? -- ellem@optonline.net There's more than one way to do it, but only some of them actually work.
Back to
Seekers of Perl Wisdom
|
|