-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Manu Hack on 1/18/2008 12:59 AM: | Hi, | | I have a data file attached. When I run
Please restrain from posting 5 megabyte files to every reader of this list - - first try to narrow your problem down to something MUCH smaller. | | wc -l < r.dat | | it gives 999. As well it should - your file only contained 999 newlines. | | but when I open the file with vim, it shows 1000 lines. Also, POSIX defines a line as text ending with a newline. So even though there are 1000 rows (and vim shows all 1000 rows), there are only 999 complete lines, and the file ends in an incomplete line and is not a text file (the POSIX definition of a text file includes the stipulation on no incomplete line unless the file is empty). | | cut -d ' ' -f1 r.dat | wc -l | | gives 1000. As well it should, since cut puts a newline after everything that it cuts from the file, whether or not it is cutting from an incomplete line. - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHkK+O84KuGfSFAYARAhj6AJ9qNUNjNQDn+C0ZQ/J0tyTz2Ra66ACfQbvO ztYkRDyFpNTAxl5UghMdogk= =VeVT -----END PGP SIGNATURE----- _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils