Extracting one record from multiple-records textfile
- From: giuseppegallone@xxxxxxxxx (Giuseppe.G.)
- Date: Tue, 27 Nov 2007 11:29:13 -0800 (PST)
Hello there. I'm a real beginner and I was wondering if you could be
so kind to help me on this.
I have a text file, containing a number of varying length documents,
all tagged with DOC-START and DOC-END, structured as follows:
DOC-START
content of the document
DOC-END
DOC-START
some text
DOC-END
DOC-START
rtreytgfbvb
DOC-END
DOC-START
sdfdf fdff ee
DOC-END
....
I need to take every document and pass it to a parsing function, that
accepts a file with *a single* document, that is
DOC-START
some text
DOC-END
My file contains lots of these records, so picking each document and
writing it into a new file is not an option. How can I extract the
documents one at a time from the file? Is it possible e.g. to put one
such record iteratively into a temporary file and pass this to the
parser?
Your help would be greatly appreciated.
Thanks
Giu
.
- Follow-Ups:
- Re: Extracting one record from multiple-records textfile
- From: John W . Krahn
- Re: Extracting one record from multiple-records textfile
- From: Jeff Pang
- Re: Extracting one record from multiple-records textfile
- From: Tom Phoenix
- Re: Extracting one record from multiple-records textfile
- Prev by Date: Re: Returning multiple MySQL rows from module
- Next by Date: about ( .)
- Previous by thread: Trouble with Email::MIME modules
- Next by thread: Re: Extracting one record from multiple-records textfile
- Index(es):