Hi all, I have the code below where I am reading an input file, reading line by line processing it and printing it out to an output file. What I need to print out is 61 chars, but the record comes with 80 chars.
The records in the file are 80 chars long but I only need 61, the way I have it right, it prints the records all in one line in the output file. I need to print it in the output file line by line but only 61 chars. how can I ignore the last 19 chars?
thanks for the help.
FILE *inputfile;
char fileRec[63];
inputfilename = getenv("INPUT_FILE_NAME");
inputfile = fopen(inputfilename, "r");
while(fgets(fileRec, sizeof(fileRec), inputfile) != NULL)
{
fprintf(outfile, "%s", fileRec);
}
The records in the file are 80 chars long but I only need 61, the way I have it right, it prints the records all in one line in the output file. I need to print it in the output file line by line but only 61 chars. how can I ignore the last 19 chars?
thanks for the help.