ezekiel has asked for the wisdom of the Perl Monks concerning the following question:
I have been given a tab separated flat file to process. Each line has at least three strings separated by tabs and (of course) a newline at the end.
I have been using a simple script to open the file, read each line, trim the newline, and split the line into an array based on tabs ie
while <FILE> { chomp; @line = split("\t"); ... do things to @line... }
Recently I have found that some strings in the line have carriage returns in them. This throws my simple routine into chaos because it is now treating the one "entry" (or line) as multiple entries (or lines).
Any ideas as to how to get around this problem?
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing lines containing extra carriage returns
by bikeNomad (Priest) on Jun 13, 2001 at 06:27 UTC | |
|
Re: Parsing lines containing extra carriage returns
by lemming (Priest) on Jun 13, 2001 at 06:48 UTC | |
|
Re: Parsing lines containing extra carriage returns
by jeroenes (Priest) on Jun 13, 2001 at 09:34 UTC |