File=’fichier.csv’

FileOut=’commandes.sql’

f = open(File, ‘r’)

fout=open(FileOut,’w’)

f.readline() #saute la premiere ligne

for line in f:

   time=line.split(« ; »)[0].strip()

   temp=line.split(« ; »)[1].strip()

   commande = « UPDATE TABLE SET COLUMN = ‘%s’ WHERE COL1=’xxxxxxxxx’ and COL2 = ‘xxxxxx’ and COL3 = ‘%s’ ; n » % (temp,time)

   fout.write(commande)

 

 

le fichier csv contient deux colonnes, une colonne temps et une colonne time.

'orm-default' et 'orm-alternative' (Doctrine)
Trouver les gros fichiers {UNIX}

Leave a Comment

Your email address will not be published. Required fields are marked *