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 40 41
|
// Ouverture du fichier
nIdFicbis = fOuvre(sFichierAImporter, foLectureEcriture)
SI nIdFicbis=-1 ALORS
Erreur("L'ouverture du fichier a échoué", ErreurInfo())
SINON
// Première ligne
sMaChaîne = fLitLigne(nIdFicbis)
sCol1 = ExtraitChaîne(sMaChaîne, 01, TAB)
sCol2 = tabPopulation
xCol3 = tabChiffreAffaire
SI sCol1 = "ALSACE"
nIdFichbis = fOuvre(sFichiertableau, foLectureEcriture)
fPositionne(nIdFichbis, 0, fpFin)
fEcritLigne(nIdFichbis, "ALSACE" + TAB + sCol2 + TAB + xCol3)
fFerme(nIdFichbis)
SINON SI sCol1 = "POITOU CHARENTE"
nIdFichbis = fOuvre(sFichiertableau, foLectureEcriture)
fPositionne(nIdFichbis, 0, fpFin)
fEcritLigne(nIdFichbis, "Poitou-charente" + TAB + sCol2 + TAB + xCol3)
fFerme(nIdFichbis)
FIN
TANTQUE sMaChaîne<>EOT
// Ligne suivante
sMaChaîne = fLitLigne(nIdFicbis)
sCol1 = ExtraitChaîne(sMaChaîne, 01, TAB)
sCol2 = tabPopulation
xCol3 = tabChiffreAffaire
SI sCol1 = "ALSACE"
nIdFichbis = fOuvre(sFichiertableau, foLectureEcriture)
fPositionne(nIdFichbis, 0, fpFin)
fEcritLigne(nIdFichbis, "ALSACE" + TAB + sCol2 + TAB + xCol3)
fFerme(nIdFichbis)
SINON SI sCol1 = "POITOU CHARENTE"
nIdFichbis = fOuvre(sFichiertableau, foLectureEcriture)
fPositionne(nIdFichbis, 0, fpFin)
fEcritLigne(nIdFichbis, "Poitou-charente" + TAB + sCol2 + TAB + xCol3)
fFerme(nIdFichbis)
FIN |
Partager