More online search seems to suggest that Xcode 4 has bugs which doesn't do redirection of output to a file.
Can I change the directory where the exe is placed so it's not so unaccessible
EWG,D,20050105,000000,18.1000,18.2400,18.0900,18.1900,1208,0
EWG,D,20050104,000000,18.4600,18.4800,18.1000,18.1800,1613,0
EWG,D,20050103,000000,18.5000,18.6400,18.4900,18.5500,1505,0
EWG,D,20130321,000000,24.8300,25.0450,24.7900,24.8600,31938,0
EWG,D,20130320,000000,25.2500,25.3000,25.1450,25.2100,31307,0
I parsed out the date, I tried various comparisons but they wouldn't work or I was making some sort of stupid mistake.
fgets(firstline, 300, oldfile);
strcpy(hold, firstline);
junk = strtok (firstline,","); //symbol
junk = strtok (NULL,","); //
date1 = strtok (NULL,",");
do
{
fprintf(newfile,"%s",hold);
if (isdigit(date1[0]))
day1 = strtoul(date1, NULL, 10);
else
break;
day2 = day1;
fgets(firstline, 300, oldfile);
strcpy(hold, firstline);
junk = strtok (firstline,","); //symbol
junk = strtok (NULL,","); //
date1 = strtok (NULL,",");
if (isdigit(date1[0]))
day1 = strtoul(date1, NULL, 10);
else
break;
printf("%s %s \n", date1, date2);
}
while( day1 < day2 );
This works.
Code:...
My suggestion applied to the "various comparisons" that didn't work, not the revised code that does work.I parsed out the date, I tried various comparisons but they wouldn't work or I was making some sort of stupid mistake.