Reputation: 6244
What's the best way to count the number of line in a file with awk, regardless of line-ending style (DOS/Windows, UNIX, etc.)?
Upvotes: 2
Views: 721
Reputation: 159
You can write a script for counting the number of lines, and get the perfect result. The script for the same is available here, Count No. of lines in UNIX which have data
Upvotes: 1
Reputation: 342353
do a dos2unix or unix2dos on the file first, before using awk.
Upvotes: 2