perl's chomp under Win-Linux
Hello,
I have adata file produced under Windows and I treat it with Perl under Linux. The problem I have is that 'chomp' doesn't work in this configuration. Any idea what to do ? Thanks. |
You need to remove the Windows carriage return from the lines as well. You see, when a text file is created under Windows, it ends the lines with a carriage return and a line feed, whereas *nix systems use just a line feed. You can use Perl, tr, sed, or a host of other programs to remove this extra character. Here is a simple Perl script to remove these extra characters and format the text file properly.
|
Quote:
Thanks. |
Then you didn't read my entire post. Try that one again. (Hint: check out the script I linked to)
The specific section I'm referring to is here (better read in-context): Code:
|
All times are GMT -5. The time now is 01:27 AM. |