commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james_strac...@yahoo.co.uk>
Subject Re: [jelly] csv file to database
Date Thu, 30 Jan 2003 14:26:52 GMT
From: "Gordon" <gordon@zareus.com>
> Would Jelly be a good tool to import a CSV file into a database? If so
> what tag would I use to parse the CSV file?

It might be nice to write a new tag or bean to parse a CSV and iterate over
its rows providing a List for each row. Then you could do things like

e.g.

<csv:forEach var="row" uri="foo.csv" colSeperator=",">
    <sql:update>
        insert into foo (a, b, c) values (?, ?, ?)
        <sql:param value="${row[0]}"/>
        <sql:param value="${row[1]}"/>
        <sql:param value="${row[2]}"/>
    </sql:update>
</csv:forEach>

James
-------
http://radio.weblogs.com/0112098/

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

Mime
View raw message