OdinsHat
3/26/2015 - 4:41 PM

Count number of headers in a CSV file using the shell/terminal/console

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