Skip to content

Instantly share code, notes, and snippets.

@zflat
Last active March 16, 2017 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zflat/f46c8007f902501b32be8d5bee5d41c9 to your computer and use it in GitHub Desktop.
Save zflat/f46c8007f902501b32be8d5bee5d41c9 to your computer and use it in GitHub Desktop.
Count lines in csv files
# Count the number of rows in csv files not counting the header row
# (assuming the header has a column named "header_col")
cat *.csv | grep -w "header_col" -c -v
# recursive
find `pwd` | xargs cat | grep -w "user_id" -c -v
# also listing files in order
ls -lR --group-directories-first
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment