CSV Parser

And that is a correct statement… this code does not create tables… it is simply a CVS importer

I looked at the importer and not sure it is what I’m looking for. In the language I use now, I select a file from my hard disk and then read the file one field at a time and insert that item into an array. Then I can process the data as I need to.

You’ve said you’re new to Object Oriented Programming, so I would recommend you put the idea of “in the language I know how to use” behind you. I had the same kind of feeling when I first started with Xojo, and it makes the transition difficult.

Norman’s original classes were designed to be used as objects. I prefer the RecordSet-like setup, and found it easy to use. Dave kind of smushed everything together when he went to fix some minor CSV glitches and add timing. I would not start there as a beginner.

Tim, What is RecordSet-like setup? I don’t understand. And I have been looking to see if there was anything that was a record, Basically a structure that will hold different type items, ie: integers, doubles, strings in what is basically an array made up of data fields. But I can not find anything.

I saw RecordSet deals with a database. I don’t need a database. I just want to read a csv file into an array, process the data in different ways, and then hold that data in a file so I can access that data later in the program. I figured out the code to let use click Load file button and open a dialog box with files available for selection. Now I need to read the csv file and process the data from those fields.

Norman’s original CSV import code has two ways to use it. One is event-driven, and the other emulates a database RecordSet. You can get Normans CSV code from his website: http://www.great-white-software.com/REALbasic_Code.html

I prefer the mode that emulates a RecordSet as it’s easy for me to use because I spend a lot of time with RecordSets and Databases. Download the code from the website, open SimpleCSVSample.rbp and look at the code on the “db like parser” button. In the most basic usage, one creates an instance of a CSVRecordSet with the FolderItem of the CSV file you’d like to parse, then iterate through it like a RecordSet. This can be threaded to keep your interface responding.

To really understand it you will need to have an understanding of Object Oriented Programming. Download Norman’s CSVParser, look around and play with it :slight_smile:

Thank you very much!

Dave’s CSV Importer link is dead. Use Norman’s.