Unix Command to get the count of lines in a csv file

Devoloper250 picture Devoloper250 · Mar 19, 2014 · Viewed 74.6k times · Source

Hi I am new to UNIX and I have to get the count of lines from incoming csv files. I have used the following command to get the count.

wc -l filename.csv

Consider files coming with 1 record iam getting some files with * at the start and for those files if i issue the same command iam getting count as 0. Does * mean anything in here and if i get a file with ctrlm(CR) instead of NL how to get the count of lines in that file. gimme a command that solves the issue. Thanks in advance.

Answer

Sathish Kumar picture Sathish Kumar · Jan 8, 2015

The following query helps you to get the count

cat FILE_NAME  | wc -l