commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Libbrecht <p...@activemath.org>
Subject Re: [jelly] csv file to database
Date Thu, 30 Jan 2003 14:46:38 GMT


Isn't there a tag to iterate over the lines of a reader or stream ?
Then
<util:tokenize var="csvRowAsAList" delim=",&quot;&apos; "
	>${lineIterator.next()}</util:tokenize>

Would do the job, wouldn't it ?

The only problem I see there is in the quotes handling for which I've 
never seen a real file specification... If there are escapes to be in 
there then a special taglib is probably required.

Le Jeudi, 30 janv 2003, à 15:26 Europe/Berlin, James Strachan a écrit :
> <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>

Such an extract really shows how sexy jelly is!

Paul

Mime
View raw message