#include #include #include #include int main(void) { char in_file[20], out_file[20], file_file[20]; int c, c1; FILE *fp_in, *fp_out, *fp_file; printf("Name of file list: "); scanf("%s", &file_file); fp_file = fopen(file_file, "r"); do{ fscanf(fp_file, "%s", &in_file); } while(strcmp(in_file, "Data:") != 0); while(fscanf(fp_file, "%s", &in_file) != EOF){ fp_in = fopen(in_file, "r"); fp_out = fopen("temp.txt", "w"); printf("%s\t", in_file); while((c = fgetc(fp_in)) != EOF){ if((c != ',') && (c != '\n')) fputc(c, fp_out); if(c == ','){ c = '\t'; fputc(c, fp_out); } if(c == '\n'){ fputc(c, fp_out); c1 = fgetc(fp_in); if((c1 != 0) && (c1 != 10)) fputc(c1, fp_out); } } fclose(fp_in); fclose(fp_out); fp_in = fopen("temp.txt", "r"); fp_out = fopen(in_file, "w"); while((c = fgetc(fp_in)) != EOF){ fputc(c, fp_out); } fclose(fp_in); fclose(fp_out); } fclose(fp_file); return 0; }