Wednesday, April 30, 2014

count a character in each line

for example, if I want to check if a CSV file without quotes is valid, something like the following might help:

tr -d -c ',\n' < file | awk '{print length;}' | uniq


No comments: