csv parser

2009-11-13 Thread Chris Sheffield
Wow, it's been a while since I've posted to the list. I first have to say 
congratulations to the Rev team on the release of Rev 4.0. I've been using it 
for a couple days now, and it's looking great.

I was wondering if anyone out there has written a csv parsing library in Rev 
and would be willing to share it. I'm in need of something that will read/write 
values to a csv file. I'll create my own if I have to, but obviously it would 
save me a ton of time if I don't have to.

Thanks,
Chris


--
Chris Sheffield
Read Naturally, Inc.
www.readnaturally.com

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: csv parser

2009-11-13 Thread Alex Tweedly

Chris Sheffield wrote:

Wow, it's been a while since I've posted to the list. I first have to say 
congratulations to the Rev team on the release of Rev 4.0. I've been using it 
for a couple days now, and it's looking great.

I was wondering if anyone out there has written a csv parsing library in Rev 
and would be willing to share it. I'm in need of something that will read/write 
values to a csv file. I'll create my own if I have to, but obviously it would 
save me a ton of time if I don't have to.

  
Not exactly a library, but there was a fairly extensive thread back in 
October 2004 about the perils of the various forms of csv file, and it 
included a couple of handlers to read in csv files - I think there was a 
very readable and straightforward one from Richard Gaskin, and later 
there was a very efficient (but significantly more complex and obscure) 
version from me, at


http://lists.runrev.com/pipermail/use-revolution/2004-October/045495.html

If you have any control at all, I'd recommend TSV (i.e. TAB Separated 
Values rather than Comma SVs).


-- alex.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: csv parser

2009-11-16 Thread Chris Sheffield
Great. Thanks, Alex. This will definitely come in handy. Point taken about 
using tabs vs. commas as the delimiter. That would be my preference too, but 
I'm not sure I have control in this case. We'll see.

Thanks again,
Chris


On Nov 13, 2009, at 4:04 PM, Alex Tweedly wrote:

> Chris Sheffield wrote:
>> Wow, it's been a while since I've posted to the list. I first have to say 
>> congratulations to the Rev team on the release of Rev 4.0. I've been using 
>> it for a couple days now, and it's looking great.
>> 
>> I was wondering if anyone out there has written a csv parsing library in Rev 
>> and would be willing to share it. I'm in need of something that will 
>> read/write values to a csv file. I'll create my own if I have to, but 
>> obviously it would save me a ton of time if I don't have to.
>> 
>>  
> Not exactly a library, but there was a fairly extensive thread back in 
> October 2004 about the perils of the various forms of csv file, and it 
> included a couple of handlers to read in csv files - I think there was a very 
> readable and straightforward one from Richard Gaskin, and later there was a 
> very efficient (but significantly more complex and obscure) version from me, 
> at
> 
> http://lists.runrev.com/pipermail/use-revolution/2004-October/045495.html
> 
> If you have any control at all, I'd recommend TSV (i.e. TAB Separated Values 
> rather than Comma SVs).
> 
> -- alex.
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

--
Chris Sheffield
Read Naturally, Inc.
www.readnaturally.com

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: csv parser

2009-11-16 Thread Dom
Chris Sheffield  wrote:

> Great. Thanks, Alex. This will definitely come in handy. Point taken about
> using tabs vs. commas as the delimiter. That would be my preference too,
> but I'm not sure I have control in this case. We'll see.

I must add that here in France -- and certainly in other european
contries, where the comma is used as a decimal separator -- the
so-called "csv" format use a _semicolon_ as a delimiter ;->


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


[ANN] CSV Parser Library 1.0.0

2010-03-08 Thread Shao Sean
This is something I put together a while back and with the recent  
discussion on the use-list I figured I would make it available for  
those that could use it..


This library will parse a CSV file into a multi-dimensional array (I  
included a simple CSV file).. On large data sets the library might  
take a while as it does basically crawl through the data character by  
character in some instances..


Syntax:
  parseCSV( data )
  parseCSV( data, true )

If the second parameter is true, the library will use the first row of  
the data as names for the column headers (like the data grid).. The  
data is returned in a multi-dimensional array where the first element  
is the row number and the second element is the column number (or  
name)..


  returnedDataArray[1][1]  -- first row, first column
  returnedDataArray[10][3]  -- tenth row, third column
  returnedDataArray[3]["file name"]  - third row, column named "file  
name"



This is released into the public domain but if you can help speed it  
up or know a slightly better way of doing some code in the library,  
please help out :-)


-Sean
http://shaosean.tk/
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution