Think about Loose Coupling | |
PerlMonks |
Processing tagged textby diggernz (Sexton) |
on Jul 19, 2006 at 09:37 UTC ( [id://562241]=perlquestion: print w/replies, xml ) | Need Help?? |
diggernz has asked for the wisdom of the Perl Monks concerning the following question:
I am wanting to process the following tagged text file to use with Adobe Indesign CS. The data is about a given horse race. I want to read this data into variables so I can create a new tagged text file to be imported into InDesign. InDesign has its own tagged format. Desired result $horse = "FRODO HEST"; $postion = "1"; $detail = "FRONT"; $history = "1 Starts: 0(0) - 0 - 0 - Lt$0($0) - W$0($0))"; $ etc Heres a sample of my previous program I used to process each line The "OUTPUT" is to the other text file I mentioned earlier. One of the problems I am facing is that the source tag file can often change (E.g. an extra field added). I am wanting some advise on a better approach to handle the processing. Can any one help me with a clear way to subtract this data into appropriate variables or arrays using pattern matching. Will I always require some hard coding for the type of tags used. I am wanting to be able to have these variables at my finger tips, so I can prompt the user to choose an approprate layout. I think i've blabbed on enough by now Thanks
Back to
Seekers of Perl Wisdom
|
|