Reading .csv file...Help

As I am new here and I’m reading and researching a lot. I can’t seem to find much about reading a CSV file. I’m starting a project that requires me to first load a race data file. It is a .csv file. Any input would help.

Thanks

second link on http://www.great-white-software.com/REALbasic_Code.html has a sample project you can lift code for reading as csv from

important things to remember

  • a CSV file CAN have the delimter WITHIN quotes 1,“2,3”,4 parses out as [1] [2,3] [4]
  • a CSV file CAN contains EndofLine Characters within quotes
  • search this forum, within the past few weeks I posted a routine modified from code written by Norman , this version is faster, as corrected a few minor bugs he had (sorry Norman :slight_smile: )

https://forum.xojo.com/40860-csv-parser

Thanks guys. I know how to do it in another language, but this OOP is all new to me.

Thanks Dave, I will look and try and understand it.

[quote=346536:@Dave S]

  • search this forum, within the past few weeks I posted a routine modified from code written by Norman , this version is faster, as corrected a few minor bugs he had (sorry Norman :slight_smile: )[/quote]
    Not sure what bugs you think you’ve found

not going to argue with you… I documented it all in private conversations months ago… there were subtle edge-cases, probably having to do with “” and " parsing… but either way thanks for the core code to start from… and not really sure why Tim is dis-avowing the method “I” used, since it was he who took you code and stripped it down to the first version of the app I linked to…
But thats fine… I have what I need, it works faster and (my opinion) more correctly… and if any one else benefits either directly or indirectly that is ok by me… If they wish to wade thru the original code that is up to them as well…

I made no changes to Norman’s code with the exception of opening up the RecordSet interface to using custom separators (I swapped a literal for a variable). My goal was to show how to use the existing code RecordSet interface within your app. I have the original file I sent you archived if there is any confusion about this.

The conversation dated July 19 mentions no bugs
And thats the only conversation we’ve had about csv I can find in the last 6 months