Andrew Gaffney <[EMAIL PROTECTED]> wrtoe:
:
: I managed to get Word to export it into a format where
: the fields are separated by '\r'. Yeah, kinda weird. I
: wrote the following:
:
: open FILE, $file;
: my $counter = 0;
:
: while (<FILE>) {
: while (/\r?([^\r]*)/sgc) {
: $counter++;
: if($counter == 10) {
: print "\n\n";
: $counter = 1;
: }
: my $temp = $1;
: $temp =~ s/\n/~~~/sg;
: $temp =~ s/\"//g;
: $temp =~ s/\'/\\'/g;
: print " $temp ";
: }
: }
:
: This should print the contents of each field as it
: reads it, which it does seem to be doing. The only
: problem is that it seems to be printing "\n\n"
: after only 7 fields. Also, will that regex get
: everything I want it to? I need to capture
: everything between each set of '\r' including the
: first field which only has a trailing '\r'.
Can you provicde some test data?
HTH,
Charles K. Clarkson
--
Mobile Homes Specialist
254 968-8328
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>