RE: Parsing large text files

2002-01-02 Thread Scott
} > close (NEWQUOTES); > close (QUOTEP); > > Rob > > > -Original Message- > From: Scott [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 02, 2002 2:50 PM > To: Hanson, Robert > Cc: [EMAIL PROTECTED] > Subject: RE: Parsing large text files >

RE: Parsing large text files

2002-01-02 Thread Hanson, Robert
D] Subject: RE: Parsing large text files Ok, I think I have it opening the file correctly, now I want to create a loop to process every record in the file. With the code below it does one line and stops. Should I put a while in front of the line processing? Thanks, open(QUOTEP,"$qivQu

RE: Parsing large text files

2002-01-02 Thread Scott
Ok, I think I have it opening the file correctly, now I want to create a loop to process every record in the file. With the code below it does one line and stops. Should I put a while in front of the line processing? Thanks, open(QUOTEP,"$qivQuoteFile"); open(NEWQUOTES, ">newtest5.txt");

Re: Parsing large text files

2002-01-02 Thread Adriano Rodrigues Ferreira
If the file is too large, don't create a list of lines in memory. You may have problems if you do it. Instead, do open(NEWQUOTES,"newquotes.txt"); open(OTHERFILE,">otherfile.txt"); while ($line=) { chomp $line; my @fields = map { $_ .= " " x (255-length($_)) } split(/,/,$line);

RE: Parsing large text files

2002-01-02 Thread Scott
Ok, do you recommend I open the file and create a list of the lines in that file? Example below on how I did the comma seperate list: open(QUOTE2,"$QuoteFile"); open(NEWQUOTES, ">>newquotes.txt"); while ($line = ) { $line =~s/\t/,/g; print NEWQUOTES "$line"; } close (NEWQUOTE

RE: Parsing large text files

2002-01-02 Thread Scott
Rob: That's me -- overthinking things again! Thank you, I am going to work on this now. -Scott On Wed, 2 Jan 2002, Hanson, Robert wrote: > You could do something like this (including the comma delimeter)... > > # a sample record > my $record = "blah1\tblah2\tblah3"; > > # split by tab

RE: Parsing large text files

2002-01-02 Thread Hanson, Robert
You could do something like this (including the comma delimeter)... # a sample record my $record = "blah1\tblah2\tblah3"; # split by tabs my @fields = split( /\t/, $record ); for (my $i = 0; $i < @fields; $i++ ) { # add 255 spaces to the field $fields[$i] .= " " x 255;