You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Martin van den Bemt <ml...@mvdb.net> on 2006/01/31 18:46:51 UTC

[csv] csv writer..

Hi everyone (specifically Henri I guess),

I need to write a csv writer (fixed size columns, semi colon seperators, etc) and I can do 2 things :
1) Create it as a project of my own.
2) Put in the csv component.

I prefer in this case the second and I will do my best to make it something really nice, but it may 
not be exactly what people had in mind.

First goal is to get the job done I need, later goals are to make it pretty..

Any objections doing my stuff in the csv component ?

Mvgr,
Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [csv] csv writer..

Posted by Martin van den Bemt <ml...@mvdb.net>.
Hmm kind of missed there was a CSVPrinter in there.. My setup is kind of different (still writing it 
though). Any problems I can go ahead anyway.. It is still sandbox and we can always integrate the 
two later on :)

Mvgr,
Martin

Martin van den Bemt wrote:
> Hi everyone (specifically Henri I guess),
> 
> I need to write a csv writer (fixed size columns, semi colon seperators, 
> etc) and I can do 2 things :
> 1) Create it as a project of my own.
> 2) Put in the csv component.
> 
> I prefer in this case the second and I will do my best to make it 
> something really nice, but it may not be exactly what people had in mind.
> 
> First goal is to get the job done I need, later goals are to make it 
> pretty..
> 
> Any objections doing my stuff in the csv component ?
> 
> Mvgr,
> Martin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [csv] csv writer..

Posted by Martin van den Bemt <ml...@mvdb.net>.
Sorry for the very late reaction, I am trying to catch up with everything atm....
See inline..


Stefan Rufer wrote:
> Sometimes one has to knock twice :-)
> 
> Basically I think it's a fine idea to have a csv writer with fixed width 
> / separators configurable!
> 
> Additionally, my thoughts about the code:
> 
> IMO it's desirable to integrate CSVWriter and CSVPrinter - already the 
> names state that they do very similar things and escaping/setting 
> delimiters and so on is coded twice. Either use inheritance to extend 
> CSVPrinter or (maybe even better) a delegation approach to add the 
> additional functionality. For exaample methods like 
> CSVPrinter.println(String[]) could be used to print in the fixed order 
> given in the input array (with padding according to the config) and 
> CSVWriter.writeRecord(Map) would only delegate to the CSVPrinter.

I agree it needs integrating, but since the code in there is (at least in my view) pretty immature, 
the extra time involved in integrating and not knowing for sure if someone depended on the code that 
was in there, I chose to add a seperate package..

There was also talk about adding dependencies to speed up things (by Henri if I remember correctly), 
but I would like to focus on a good API and later make things better..

> 
> Then having a CSVConfig to set the different parameters looks good - 
> especially with the load of parameters that are available. That's a 
> thing the CSVPrinter could use as well.

CSVConfig insn't a one on one mapping with the CSV stuff that already was in subversion at the time.

So the real question is : do you depend on the original code in subversion or can we start breaking 
things ?

Mvgr,
Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [csv] csv writer..

Posted by Stefan Rufer <st...@netcetera.ch>.
Sometimes one has to knock twice :-)

Basically I think it's a fine idea to have a csv writer with fixed width / 
separators configurable!

Additionally, my thoughts about the code:

IMO it's desirable to integrate CSVWriter and CSVPrinter - already the 
names state that they do very similar things and escaping/setting 
delimiters and so on is coded twice. Either use inheritance to extend 
CSVPrinter or (maybe even better) a delegation approach to add the 
additional functionality. For exaample methods like 
CSVPrinter.println(String[]) could be used to print in the fixed order 
given in the input array (with padding according to the config) and 
CSVWriter.writeRecord(Map) would only delegate to the CSVPrinter.

Then having a CSVConfig to set the different parameters looks good - 
especially with the load of parameters that are available. That's a thing 
the CSVPrinter could use as well.


Comments welcome!

cu
Stefan

On Fri, 10 Feb 2006, Martin van den Bemt wrote:

> From: Martin van den Bemt <ml...@mvdb.net>
> To: Jakarta Commons Developers List <co...@jakarta.apache.org>
> Subject: Re: [csv] csv writer..
> Date: Fri, 10 Feb 2006 21:21:37 +0100
> 
> ping :)
>
> Mvgr,
> Martin
>
> Martin van den Bemt wrote:
>> My initial stuff has been committed. Let me know if it is usefull or 
>> someone wants it removed..
>> (package org.apache.commons.csv.writer)
>> It already does some (for me) usefull writing :)
>> 
>> Mvgr,
>> Martin
>> 
>> Martin van den Bemt wrote:
>> 
>>> Hi everyone (specifically Henri I guess),
>>> 
>>> I need to write a csv writer (fixed size columns, semi colon seperators, 
>>> etc) and I can do 2 things :
>>> 1) Create it as a project of my own.
>>> 2) Put in the csv component.
>>> 
>>> I prefer in this case the second and I will do my best to make it 
>>> something really nice, but it may not be exactly what people had in mind.
>>> 
>>> First goal is to get the job done I need, later goals are to make it 
>>> pretty..
>>> 
>>> Any objections doing my stuff in the csv component ?
>>> 
>>> Mvgr,
>>> Martin
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>> 
>>> 
>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>> 
>> 
>> 
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>

--
Stefan Rufer | stefan.rufer@netcetera.ch
phone +41 (0)44 247 79 92 | fax +41 (0)44 247 70 75
Netcetera AG | 8040 Zürich | Switzerland | http://netcetera.ch

Re: [csv] csv writer..

Posted by Martin van den Bemt <ml...@mvdb.net>.
ping :)

Mvgr,
Martin

Martin van den Bemt wrote:
> My initial stuff has been committed. Let me know if it is usefull or 
> someone wants it removed..
> (package org.apache.commons.csv.writer)
> It already does some (for me) usefull writing :)
> 
> Mvgr,
> Martin
> 
> Martin van den Bemt wrote:
> 
>> Hi everyone (specifically Henri I guess),
>>
>> I need to write a csv writer (fixed size columns, semi colon 
>> seperators, etc) and I can do 2 things :
>> 1) Create it as a project of my own.
>> 2) Put in the csv component.
>>
>> I prefer in this case the second and I will do my best to make it 
>> something really nice, but it may not be exactly what people had in mind.
>>
>> First goal is to get the job done I need, later goals are to make it 
>> pretty..
>>
>> Any objections doing my stuff in the csv component ?
>>
>> Mvgr,
>> Martin
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [csv] csv writer..

Posted by Martin van den Bemt <ml...@mvdb.net>.
My initial stuff has been committed. Let me know if it is usefull or someone wants it removed..
(package org.apache.commons.csv.writer)
It already does some (for me) usefull writing :)

Mvgr,
Martin

Martin van den Bemt wrote:
> Hi everyone (specifically Henri I guess),
> 
> I need to write a csv writer (fixed size columns, semi colon seperators, 
> etc) and I can do 2 things :
> 1) Create it as a project of my own.
> 2) Put in the csv component.
> 
> I prefer in this case the second and I will do my best to make it 
> something really nice, but it may not be exactly what people had in mind.
> 
> First goal is to get the job done I need, later goals are to make it 
> pretty..
> 
> Any objections doing my stuff in the csv component ?
> 
> Mvgr,
> Martin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org