Couple comments:#!/usr/bin/perl # convert a dos \r\n format to unix \bn open (FILE, $ARGV[0]); while (<FILE>) { # remove the stupid \r, replace with \n # some broken editors just put \r s/\r/\n/g; # Remove the duplicate \n s/\n\n/\n/g; print; }
Update Chromatic offered an easier way to do this. In fact I am sure that is the better way to do it, and in fact at some point it was written similar to that. The hell if I rememeber why I changed it. But it basically came down to its origins and the fact I didn't want ANY blank lines.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Dos2Unix file formater
by chromatic (Archbishop) on Apr 14, 2000 at 20:55 UTC |