[Helma-user] CSV Reader

Joshua Paine joshua at papercrown.org
Tue Apr 29 23:37:59 CEST 2008


I needed a CSV reader, so I made one using the Apache-licensed opencsv
from <http://opencsv.sourceforge.net/>. I can't recall if attachments
make it through to this list, but I'm giving it a try. This is
undocumented, but it's only 40 lines and should be quite obvious.

It can return lines as arrays or as hashmaps (JavaScript Object) with
the column headings used as the keys. The only thing that might not be
obvious is that for the latter style you have to call getHeaders()
before trying to read anything.

-- 
Joshua Paine
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CSVReader.js
Type: application/javascript
Size: 1164 bytes
Desc: not available
Url : http://helma.org/pipermail/helma-user/attachments/20080429/2a2af2a1/attachment.bin 


More information about the Helma-user mailing list