Author Topic: [Resource] CSV Reader (comma/character-separated-value)  (Read 2482 times)

This is an extremely simply CSV reader that allows you to read values from strings.

Usage example:
Code: [Select]
==>$csv = CSVReader(",", "Testing 1 2 3!,     spaces, \"This is in quotes, allowing commas.\",,and a final one");
==>while($csv.hasNextValue()) echo($csv.readNextValue());
Testing 1 2 3!
     spaces
This is in quotes, allowing commas.

and a final one


Get the code here: http://greek2me.us/code/Support_CSVReader.cs

I'm curious what you used CSVs for that you needed this

I'm curious what you used CSVs for that you needed this
Slayer config files.

I guess the only advantage here is the quotes allowing commas? you could use nextToken...

I guess the only advantage here is the quotes allowing commas? you could use nextToken...

Yeah, I did it because the values I'm working with can contain any character such as commas or tabs.