1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| import os, sys, csv, fnmatch
for sFile in os.listdir('//nas.profa.ch/ICC-PROFA/IN'):
if fnmatch.fnmatch(sFile, 'A*.GDT'):
sFileDelete = sFile;
GDT = open( os.path.join('//nas.profa.ch/ICC-PROFA/IN' , sFile),"r");
f=[];
for i in range(13):
f.append(GDT.readline().strip())
NumClient = (f[6])
NumClient = NumClient[7:];
Nom = (f[7]);
Nom =Nom[7:];
Prenom = (f[8]);
Prenom =Prenom[7:];
DN = (f[9]);
DN =DN[7:];
Ville = (f[10]);
Ville =Ville[7:];
Adresse = (f[11]);
Adresse =Adresse[7:];
with open('//nas.profa.ch/ICC-PROFA/IN\ICC_PROFA.txt','a') as f:
writer=csv.writer(f)
writer.writerow([NumClient, Nom, Prenom, DN, Ville, Adresse])
f.close;
site = 'https://www.laboicc.ch/profacmd/pcommande1.php?pkMandant=140194&pkPatient=' + NumClient
import webbrowser
webbrowser.open(site)
os.remove(os.path.join('//nas.profa.ch/ICC-PROFA/IN' , sFileDelete)) |
Partager