Reading multiple lines from a CSV file, each line having about 300 data values. There are @100 lines

Reading multiple lines from a CSV file, each line having about 300 data values. There are @100 lines

Hi,

I have been attempting to read a CSV file and populate an array of arrays. I'm using the functions, F_ROPEN, F_SEEK, FM_READ, F_EOF etc..

The different values of data(type = Dint) are separated by commas in the CSV file, with CR+ LF at the end of each line.

It looks like this
5255,0,12236,11927,12089,11803,10369,10524,12009,12517,15154,17671,20596,21825,22880...............Some 300 values......13622,14176,14814,14819,13507,12936,13378,\r\n


I find that each value of String read by FM_READ includes the whole line as a string with a limit of 255 characters. The commas are also included as part of the string!
Even if I use spaces or tabs, the same thing happens. FM_Read always returns a string of 255 characters, ignoring the separator values.
It looks like this ..

'1751,1,8702,11897,12119,11271,10281,10963,12158,12972,15774,18872,20934,22159,23211,24308,25301,25770,25994,25915,25966,27523,28414,29155,30170,31736,33403,35616,37665,39072,41097,43250,45021,46934,47929,48924,50022,51427,52717,53842,54685,56264,57734,587'

Kindly guide me how to insert a suitable suitable string terminating character so that each value is read independently as a separate string.

Thanks and regards




This is a migrated post! Originally posted on 09.05.2022 by user rajsiyer. Please be aware that information can be outdated.