I am trying read CSV files in a C program on an AIX system. I am having problems getting fscanf to recognize the comma delimeter. I have read previous posts on this issue, and used the techniques dicussed in those threads, but I am still having the issue. Specifically, this problem was in a thread from a year ago, and the solution was to remove the comma using %c on integer/decimal fields, and adding a mask for string fields, i.e.,
%[^ \t\n\r\v\f,]%c. I have tried that, but I still am not getting the fscanf to work. It reads all of the line into the first variable, a string variable. I don't know if the problem is that I am running on AIX, and the solution I found is for Linux, or if the problem is that my input CSV file does not have any whitespace, all of the fields are separated only by commas. Anyone have any ideas on what the issue is?
JohnMcPherson 12 Junior Poster in Training
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
JohnMcPherson 12 Junior Poster in Training
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
JohnMcPherson 12 Junior Poster in Training
JohnMcPherson 12 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.