head -n1 input.csv | grep -o "," | wc -l
head -n1 input.csv | grep -o " " | wc -l
Source: https://stackoverflow.com/questions/5761212/count-number-of-columns-in-bash
head -n1 input.csv | grep -o "," | wc -l
head -n1 input.csv | grep -o " " | wc -l
Source: https://stackoverflow.com/questions/5761212/count-number-of-columns-in-bash