C language - Fscanf and sprint commands in unix environment
Posted
by yanag
on Stack Overflow
See other posts from Stack Overflow
or by yanag
Published on 2010-06-08T07:40:24Z
Indexed on
2010/06/08
7:42 UTC
Read the original article
Hit count: 221
I am trying to read file with 30 rows and 5 columns with separator of "tab". Each time I get only part of the rows. In the windows environment it's working good. Any idea why in unix it is not working?
while (fscanf(FFMapFile,"%s\t%s\t%s\t%s\t%s\t",fnfMap[i].COS_ID,fnfMap[i].FF_First_Act,fnfMap[i].FF_Next_Act,fnfMap[i].Free_FF_allowed,fnfMap[i].FF_Change_Charge)!=EOF)
{
sprintf(s,"%s\t%s\t%s\t%s\t%s\t",fnfMap[i].COS_ID,fnfMap[i].FF_First_Act,fnfMap[i].FF_Next_Act,fnfMap[i].Free_FF_allowed,fnfMap[i].FF_Change_Charge);
error_log(s,ERROR);
i++; }
© Stack Overflow or respective owner