Last active
August 29, 2015 14:17
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/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