Skip to content

Instantly share code, notes, and snippets.

@krlsdu
Last active September 28, 2016 19:50
Show Gist options
  • Save krlsdu/2d6f4a9319628b962dbdfa9b262138d2 to your computer and use it in GitHub Desktop.
Save krlsdu/2d6f4a9319628b962dbdfa9b262138d2 to your computer and use it in GitHub Desktop.
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