nofernandes has asked for the wisdom of the Perl Monks concerning the following question:
I have a file that contains various information. Each kind of information has a specific tag, like xml or html, but is not a document of this type.
The file is like this:
<FMS> <HEAD> ORADEV61 GL_FORMS FULL_ANALYSIS ORAFORMS50 GET_DATABLOCK_REFS </HEAD> [<OPEN_API> Server8i User1 READABLE passworduser1 </OPEN_API>] <MOD> <NOT_REANALYZED> "G:\GL_FORMS_4\gsdl.fmb" GL "G:\GL_FORMS_4\glccat.fmb" GL "G:\GL_FORMS_4\glsdcnv.fmb" "G:\GL_FORMS_4\glcovsca.fmb>" GL </NOT_REANALYZED> <EXTERNAL> </EXTERNAL> <REANALYZED> "G:\GL_FORMS_5\glsss.fmb" GL "G:\GL_FORMS_5\glcxcvat.fmb>" GL "G:\GL_FORMS_5\glcsdsnv.fmb" GL "G:\GL_FORMS_5\glcqsoa.fmb" "G:\GL_FORMS_5\glcqsdvur.fmb" "G:\GL_FORMS_5\gldeqsdf.fmb" GL "G:\GL_FORMS_5\glg xf rp.fmb" GL "G:\GL_FORMS_5\gljou.fmb.fmb" GL "G:\GL_FORMS_5\gl sou.fmb" "G:\GL_FORMS_5\gl sou2.mmb.mmb" GL </REANALYZED> </MOD> </FMS>
My purpose is too erase the content within the <REANALYZED> and </REANALYZED> or any other tags and substitute for a new one..new files!
Whatīs the best way to do that??
Must i use regex or is there a module to do this kind of operations?
Thank you for your valuable help.
Nunoedited by ybiC: removed funky ķ EOL chars
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Search and Replace
by liz (Monsignor) on Aug 27, 2003 at 09:17 UTC | |
|
Re: Search and Replace
by cchampion (Curate) on Aug 27, 2003 at 12:25 UTC | |
by dbwiz (Curate) on Aug 27, 2003 at 14:47 UTC | |
|
Re: Search and Replace
by aquarium (Curate) on Aug 27, 2003 at 12:41 UTC | |
|
Re: Search and Replace
by Abigail-II (Bishop) on Aug 27, 2003 at 09:18 UTC | |
by nofernandes (Beadle) on Aug 27, 2003 at 09:34 UTC | |
by liz (Monsignor) on Aug 27, 2003 at 09:50 UTC | |
by nofernandes (Beadle) on Aug 27, 2003 at 10:02 UTC | |
|
Re: Search and Replace
by nofernandes (Beadle) on Aug 27, 2003 at 15:31 UTC | |
by Not_a_Number (Prior) on Aug 27, 2003 at 20:37 UTC |