calais-data

Des données sur le passage à Calais - retour accueil

git clone git://bebou.netlib.re/calais-data
Log | Files | Refs | README |

download.sh (517B)


      1 #! /bin/sh
      2 
      3 link=$(curl -Ls https://www.gov.uk/government/publications/migrants-detected-crossing-the-english-channel-in-small-boats |
      4 	grep -o 'https://.*time_series.ods' |
      5 	head -n1)
      6 
      7 curl -Ls "$link" > downloaded.ods
      8 
      9 tsvfilename=$(libreoffice --convert-to csv:"Text - txt - csv (StarCalc)":9,34,UTF8,1,,0,false,true,false,false,false,3 downloaded.ods |
     10 	grep -oE "[^ ]*\.csv" |
     11 	tail -n1)
     12 
     13 < "$tsvfilename" cut -f-3 | sed -E 's,([0-9]*)/([0-9]*)/([0-9]*)	,\3/\2/\1	,' | tail -n+2
     14 
     15 rm $tsvfilename downloaded.ods
     16