PrimeLord has asked for the wisdom of the Perl Monks concerning the following question:
Each entry I am trying to parse out starts with the d-dd-ABCdd line and I basically need the lines below it until the next entry starts. So examples of what I am trying to parse out are:!Data. $ 1-11-ABC22 (12:12) ABC 12 Foo Bar Foo Bar Foo Bar Foo Bar 2-15-ABC33 (12:12) ABC 12 Foo Bar Foo Bar Foo Bar Foo Bar -- 1-11-ABC33 (12:12) ABC 12 Foo Bar Foo Bar Foo bar Foo Bar -- 1-11-ABC33 (12:12) ABC 12 Foo Bar Foo Bar Foo abr Foo bar Foo Bar Foo Bar Foo Bar -- 2-15-ABC45 (12:12) ABC 12 Foo Bar Foo Bar Foo Bar Foo Bar 3-33-ABC15 (12:12) ABC 12 Foo Bar Foo Bar !Data *
And...1-11-ABC22 (12:12) ABC 12 Foo Bar Foo Bar Foo Bar Foo Bar
etc... It would be easy enough to just split on lines that starts with a \n or a --, but the -- is part of the entry that I need to retain. Any ideas on how a good way to parse out this information? I appreciate any help you can offer. Thanks!1-11-ABC33 (12:12) ABC 12 Foo Bar Foo Bar Foo abr Foo bar Foo Bar Foo Bar Foo Bar --
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help Parsing a Text File
by tcf22 (Priest) on Mar 23, 2004 at 19:02 UTC | |
|
Re: Help Parsing a Text File
by YuckFoo (Abbot) on Mar 23, 2004 at 19:10 UTC | |
|
Re: Help Parsing a Text File
by Roy Johnson (Monsignor) on Mar 23, 2004 at 19:20 UTC | |
|
Re: Help Parsing a Text File
by tachyon (Chancellor) on Mar 23, 2004 at 19:16 UTC | |
by PrimeLord (Pilgrim) on Mar 23, 2004 at 19:51 UTC | |
|
Re: Help Parsing a Text File
by Anonymous Monk on Mar 23, 2004 at 19:43 UTC |