Sometimes we may need to get records count from file . For that we can use wc -l , command with file name. In some situation the file will be in compressed format . wc -l will not directly work with zipped files . In this case we can do zcat the file and pipe the word count command with it.
Example :
Let say we have a file cricketData.dat.gz
To get word count from the file use :
zcat cricketData.dat.gz | wc -l
This will give the record count.
Comments
Post a Comment