Traitement-signal-plantes/Code-C/fileGestion.c

17 lines
457 B
C

#include "fileGestion.h"
void clearRawData(int N){
char buffer[256];
FILE *f = fopen("newFile.txt","w+");
FILE *g = fopen("rawData.txt","r");
for(int i = 0; i < N; i++){
fgets(buffer , sizeof buffer , g);
//printf("Line contaigns: %s" , buffer);
}
while(1){
if(!fgets(buffer,sizeof buffer , g)) break;
fprintf(f,"%s",buffer);
}
remove("rawData.txt"); rename("newFile.txt", "rawData.txt");
}