}
> 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
>
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
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");
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);
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
= substr($fields[$i],0,255);
> }
>
> # only include fields #0 and #2 (change to your needs)
> @fields = @fields[0,2];
>
> # print the comma delimeted fields
> print join(',', @fields);
>
>
> Rob
>
> -Original Message-
> From: Scott [mailto:[EMA
m: Scott [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 02, 2002 11:22 AM
To: [EMAIL PROTECTED]
Subject: Parsing large text files
Hi:
I am developing a input routine in perl that will take a SQL exported file
in tab delimited format and convert it to something that our mainframe can
proces
Hi:
I am developing a input routine in perl that will take a SQL exported file
in tab delimited format and convert it to something that our mainframe can
process. The file will ultimately have 255 characters for each field.
I have been successful in replacing the tabs with comma's, but now