Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Handle DOS Line Endings' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Handle DOS Line Endings
Authored by: kal on Feb 09, '03 05:43:49AM

>In its raw form, the html has DOS line endings, which
>makes it hard to manipulate via UNIX tools.

Not if you use the right unix tool :-) The unix "tr" (translate) command should help you get rid of the carriage return character. For instance on the file test:

cat test | tr -d "\r"

Should remove all carriage returns from the file test and print it to STDOUT.



[ Reply to This | # ]
Handle DOS Line Endings
Authored by: kerbaugh on Feb 09, '03 08:57:24AM
   You're right of course. What I should have said was that it "makes it difficult to handle with UNIX tools unless they are removed". I couldn't figure out at first why my matches weren't matching. All UNIX text editors have convenient means of deleting things; I just used sed to do it since I was already in sed.
--
Gary
~~~~
   Line Printer paper is strongest at the perforations.

[ Reply to This | # ]