seaver has asked for the wisdom of the Perl Monks concerning the following question:
I've recently come across a file, i think it's from a mac, which, on my RH9 box, shows it's line breaks as:
'^M'.
As a result of which, when trying to read in the file, it does NOT read in any lines, or so I believe.
has anyone come across this before?
Cheers
Sam
UPDATE:
The code belwo is basically what I'm using, and there's NO output.
#!/usr/bin/perl -w use strict; my $file = $ARGV[0]; while(<$file>){ print $_; }
the file looks a little like this, remember the linebreaks are '^M':
ATOM 5 OE2 GLU A 3 116.164 67.506 12.993 1.00129.84 8^MATOM 6 C GLU A + 3 115.793 66.073 17.878 1.00101.37 6^MATOM 7 O GLU +A 3 116.641 65.434 18.500 1.00 95.58 8^MATOM 8 N GLU A 3 117.2 +31 68.120 18.071 1.00102.98 7^MATOM 9 CA GLU A 3 11 +5.864 67.588 17 .783 1.00103.63 6^MATOM 10 N GLU A 4 114.768 65.506 +17.255 1.00 97.10 7^MATOM 11 CA GLU A 4 114.577 64.06 +7 17.260 1.00 9 1.36 6^MATOM 12 CB GLU A 4 113.440 63.684 18.207 1.00 + 99.04 6^MATOM 13 CG GLU A 4 113.897 63.263 19.592 1 +.00118.55 6^MAT OM 14 CD GLU A 4 112.731 62.936 20.505 1.00127.23 6^M +ATOM 15 OE1 GLU A 4 111.851 62.147 20.096 1.00129.74 +8^MATOM 16 O E2 GLU A 4 112.699 63.467 21.635 1.00130.22 8^MATOM 17 + C GLU A 4 114.281 63.539 15.867 1.00 84.90 6^M
|
|---|