Unfortunately the content of data may quite tricky. Still comma is the deliminator, but some data on a row could be like this:

IDFNLNAGECOMMENT

123, John, Smith, 39, I said "Hey, I am 5'10"."

so this is one of the string on the comment column:

I said "Hey, I am 5'10"."

No kidding, I need to show above comment without compromise in excel or open office from a CSV file generated by Java, and of course cannot mess up other regular escaping situation(i.e. regular double quotes, and regular comma within a tuple). I know regular expression is powerful but how can we achieve the goal with such complicated situation?

I'm pretty sure Oracle (and the rest of the major RDBMSs) has an 'export' function that performs this function. Barring that, there's probably an open-source version that would interface with pretty much anything through JDBC, given how common this type of functionality is needed.
–
Clockwork-MuseMay 4 '12 at 15:40

Thanks X-Zero but here the job actually relies on the controller side. But still very helpful idea :)
–
DreamerMay 4 '12 at 18:44

simply saying if there is special character like comma or double quote within the string in side the cell, then first escape the double quote("\"") by adding additional double quote (like "\"\""), then put the whole thing into a double quote (like "\""+theWholeThing+"\"" )