Just figured I would chime in here seeing I have done such things in the past. Please remember you will need to either replace comma's in the document with another character or else escape them if you do not want to run into problems.
I personally quote the entire field if there is a comma in the field and then escape the quote's if need be. This is also the way Microsoft exports to CSV so it is great for compatibility. HTH's, Steve. -- "Winston, you are drunk." - Lady Astor "Yes my dear, but you are ugly, and in the morning I shall be sober" - Winston Churchill -----Original Message----- From: Knepp, Ethan [mailto:[EMAIL PROTECTED] Sent: Thursday, July 03, 2003 3:26 PM To: 'POI Users List' Subject: RE: Can POI create a CSV file? Ya, I didn't know if there was a utility api that would take a WorkBook and its worksheets and create multiple csv files. Just thought I would ask. I will just resort to a solution similart to your suggestion Nate Thanks! -----Original Message----- From: Nate [mailto:[EMAIL PROTECTED] Sent: Thursday, July 03, 2003 3:27 PM To: POI Users List Subject: Re: Can POI create a CSV file? I don't think that POI can do this, but it begs the question: Why bother with the extra overhead? Just build a StringBuffer and append a row to it for each row in the resultset. Very fast, very easy. --Nathan McMinn ----- Original Message ----- From: "Knepp, Ethan" <[EMAIL PROTECTED]> To: "POI User List (E-mail)" <[EMAIL PROTECTED]> Sent: Thursday, July 03, 2003 2:17 PM Subject: Can POI create a CSV file? > I currently am using the POI's HSSF to write the entire results from an SQL > queries Result Set into a Excel Spreadsheet. This was easy and it works > great. > > I recently got a request from a customer to modify the utility to allow for > the result set to be written to a Comma Separated Value(CSV) file. Does POI > have any utility methods/APIs to write to CSV files? > > Thanks, > Ethan > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
