tomatoiscoding
10/2/2017 - 3:09 AM

missing values, count unique values

cut -d ',' -f1 FDADOS_CENSO2014.csv|tail-n +2|sort|uniq -c|sort -nr
awk -F, '$2!=" "' test1.txt > test2.txt
# calculate the number of fields in a csv file
head -n 1 FDADOS_CENSO2014.csv | awk -F ',' '{print NF}'
# count null values using awk
for j in {1..123}
do
  awk -F, -v i=$j '$i==" "{N++} END{print N}' FDADOS_CENSO2014.csv >> empty
done