Skip to content

Instantly share code, notes, and snippets.

@OdinsHat
Last active August 29, 2015 14:17
Show Gist options
  • Save OdinsHat/db36a9f288ecd9f1a3e2 to your computer and use it in GitHub Desktop.
Save OdinsHat/db36a9f288ecd9f1a3e2 to your computer and use it in GitHub Desktop.
Count number of headers in a CSV file using the shell/terminal/console
#/bin/sh
# Count number of headers in all CSV files in the current directory
for i in `ls`; do echo $i; head -1 $i | sed 's/,/ /g' | wc -w;done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment