07-28-2009 06:20 AM
Hi,
I need small help related to reading contents from .CSV file.
My code is as follows:
FP = OpenFile("FileName.csv", VAL_READ_ONLY, VAL_OPEN_AS_IS, VAL_ASCII);
ReadLine(FP,Line,-1);
I am using Scan() function to store all those values in seperate variable.
But I am getting following error near format string of Scan().
Please help me in this regard.
Thanks,
Harika
Solved! Go to Solution.
07-28-2009 08:00 AM
Hi Harika,
probably the easiest and fastest method to scan more than 100 arguments from a line is to use the 'rep' keyword in the format string, like you can see in the onluen documentation and in the following example taken from CVI help: look for "String with comma-separated ASCII values to real array" in the linked page. After reading back the values you can decide how to split your array of values into meaningful variables of yours.
Another option could be to read in a line and then to manually handle it in a loop using strtok () function to break the line into single values.
07-28-2009 09:15 AM
Many Thanks !!!
Your suggestion really helped alot......