Microsoft operating systems use different characters for line endings than
unix boxes. I believe it is the equivalent to the UNIX \r\n.
Sent: Tuesday, July 02, 2002 4:43 PM
Subject: Processing text
I'm kind of new to perl and i've come accross a problem:
I have a large text file with fields separated by pipes which should appear
ABIT|GC|MX200|nVIDIA GeForce 2 MX200 32MB AGP
However alot of entries are split over 2 lines like this:
I wrote a small perl script to split the lines by a pipe into an array, and
if the array size was less than a certain value, join it with the next line.
To test the script i copied a few paragraphs from the big text file to test
on. When i ran the script on the small file, it sorted everything perfectly.
But whenever i ran the script on the full file it always came out wrong,
after a few hours of frustration, i ended up copying the entire file and
pasting it to a new file. After running the script on the new file, it
sorted it fine??
The original file was saved on a windows machine, and i copy/pasted it
through a linux text editor. I noticed when i edit the original file using
vi, down the bottom next to the file name is [dos]. Im thinking this has
something to do with it.
Thanks in advance for any help or ideas that some of you may have,