Okay, here is some low hanging fruit.
I have a text file with a million rows (1 record per row). Each record is a string consisting of numbers, followed by an asterisk, followed by a single space. Each row is terminated with a carriage return+Line Feed. I need to create a second file that consists of all these records on one row.
Here is what I have so far. The best I have been able to figure out is how to copy the contents of the source file into the new file.
Thanks for the help!!
#define ARSIZE 16
#define SRCNAME "C:\\ValidCust.txt"
#define DSTNAME "C:\\newcust.txt"
errno = 0;
readfile = fopen( SRCNAME, "r" );
writefile = fopen( DSTNAME, "w" );
if( readfile == NULL || writefile == NULL )
"Open file error: %d, \"%s\"\n",
strerror( errno )
while( fgets( buffer, sizeof( buffer ), readfile ) != NULL )
fputs( buffer, writefile );
fclose( readfile );
fclose( writefile );