fb3a6dbea7c09e0b748655033ea3398eb768298b
[platal.git] / modules / fusionax / import-ax.sh
1 #! /bin/bash
2
3 # import des données
4 #scp -i ax_xorg_rsa xorg@polytechniciens.com:/home/axasso/ax-import/export_4D.txt.rar .
5 #unrar e -inul export_4D.txt.rar
6 cp /home/x2004jacob/export*utf8.TXT .
7
8 # séparation en fichiers de tables
9 cat export_total* | grep ^AD > Adresses.txt
10 cat export_total* | grep ^AN > Anciens.txt
11 cat export_total* | grep ^FO > Formations.txt
12 cat export_total* | grep ^AC > Activites.txt
13 cat export_total* | grep ^EN > Entreprises.txt
14
15 exit 1
16
17 # intégration dans notre bdd
18 echo intégration dans notre bdd
19 $MYSQL x4dat < Activites.sql
20 $MYSQL x4dat < Adresses.sql
21 $MYSQL x4dat < Anciens.sql
22 $MYSQL x4dat < Entreprises.sql
23 ./formation.pl
24 cat Formations_out.txt > Formations.txt
25 rm -f Formations_out.txt
26 $MYSQL x4dat < Formations.sql
27
28
29 # nettoyage
30 echo nettoyage
31 #rm Adresses.txt Anciens.txt Formations.txt Activites.txt Entreprises.txt export_4D.txt.rar export-total*
32 rm Adresses.txt Anciens.txt Formations.txt Activites.txt Entreprises.txt export-total*