I need to count the number of columns in CSV files. If less than 11, rename the file appending the
.bad suffix. I tried this but it's short of what I need:
head -1 myfile.csv | sed 's/[^,]//g' | wc -c
I need to do it for all files in a directory.