Skip to content

Instantly share code, notes, and snippets.

@rhanka
Created March 30, 2020 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rhanka/a0ee2751c8d0fc522b65d64d11ed38d3 to your computer and use it in GitHub Desktop.
Save rhanka/a0ee2751c8d0fc522b65d64d11ed38d3 to your computer and use it in GitHub Desktop.
#!/bin/bash
sudo apt-get install python pip wget
pip install jq xq
wget -rl1 https://echanges.dila.gouv.fr/OPENDATA/CASS/
find -iname '*.tar.gz' | xargs tar xvzf
nxml=`find -iname '*.xml'| wc -l`;(find -iname '*.xml' | xargs -n 1 -P 6 -I {} bash -c 'file={};cat $file | xq "." > ${file/xml/json}' &) && while(true);do find -iname '*.json' | wc -l | awk -v nxml=$nxml '{printf "\rconversion xml>json en cours : " $1 "/" nxml}';sleep 1;done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment