I don't think the you need a regex for getting the data in. You
only need to do something like:
my $MyData = ''
while ( <FILEIN> ) {
chomp;
if ( /^DataSource\s+Name\s+/ ) { # Hit on start of
data
proc_search($MyData) if ( $MyData gt '' ); # MyData has data to
process
$MyData = $_; # Get the
initial data
}else {
$MyData .= ';' . $_; # Need some
type of separator
}
}
One possible way.
Wags ;)
-----Original Message-----
From: Scott Seitz [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 21, 2001 12:02
To: [EMAIL PROTECTED]
Subject: Complex RegEx Question
I have a 6M text file which has a fairly complex
structure. The file has certain key words that I need
to use as delimiters. A sample of the file is below:
DataSource Name "x" Separator " " SourceType "z"
CharactherSet Ansi
DecimalSep "." Thousandsep ","...
DataSource Name "y" Separator " " ...
The file actually has a few hundred lines of these
name/value pairs between the DataSource identifiers.
These scan a variable number of lines. I want to
create a single variable (let's call it $Data) of all
of the information between instances of the keywords.
Then I want to parse $Data a couple of dozen times to
look for certain name/value pairs.
I think I can work out the name/value pairs. What I
don't understand is how to create a variable with all
of the data (crossing lines) between the two keywords.
Any help would be appreciated. Thank you.
Scott
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/