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 42 43
| #include <fstream>
#include <string>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <iostream>
#include <fstream>
using namespace std;
int main(int argc, char* argv[], int i)
{
unsigned int ligne_nbr = 0;
char * ligne;
ifstream file( "extract_ic.csv" ); // le fichier texte
if ( file ) // on vérifie si l'ouverture du fichier a réussi
{
string line1;
getline( file, line1 );
ofstream outfile ("entete_extract_ic.txt", ios::app);
outfile << line1 <<"\n";
string line;
while ( getline( file, line ) )
{
//getline( file, line);
ofstream outfile ("extract.txt", ios::app);
outfile << line <<"\n";
}
//++ligne_nbr;
}
//printf("%d\n", ligne_nbr);
//system("Pause");
return 0;
} |
Partager