Last active
September 28, 2016 19:50
-
-
Save krlsdu/2d6f4a9319628b962dbdfa9b262138d2 to your computer and use it in GitHub Desktop.
This file contains 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
for i in {01..12} ; do | |
wget --content-disposition "http://arquivos.portaldatransparencia.gov.br/downloads.asp?a=2015&m=$i&consulta=GastosDiretos" | |
done | |
unzip \*.zip -d extraidos | |
for f in *.csv ; do | |
FILE="$f" | |
tail -n +2 "$FILE" > "$FILE.tmp" && mv "$FILE.tmp" "$FILE" ; done | |
for f in *.csv ; do | |
FILE="$f" | |
sed -i -e 's/\x0/NULL/g' "$FILE" | |
; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment