« Return to Thread: CSV Reader

CSV Reader

by Joshua Paine :: Rate this Message:

Reply to Author | View in Thread

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


_______________________________________________
Helma-user mailing list
Helma-user@...
http://helma.org/mailman/listinfo/helma-user

CSVReader.js (1K) Download Attachment

 « Return to Thread: CSV Reader

LightInTheBox - Buy quality products at wholesale price