Last active
October 8, 2017 09:52
-
-
Save tomatoiscoding/352bd308f55a325ad3e42936e2868ef8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cut -d ',' -f1 FDADOS_CENSO2014.csv|tail-n +2|sort|uniq -c|sort -nr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| awk -F, '$2!=" "' test1.txt > test2.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment