xlsx2csv icon indicating copy to clipboard operation
xlsx2csv copied to clipboard

column values with line breaks

Open mariomuja opened this issue 5 years ago • 5 comments

it would be great to have an option to replace each line break in a field value by a single space character

currently, line breaks are preserved in the resulting text file and this stops me from further processing with SQL Server Integration Services (ssis cannot manage line breaks in csv files) - I had to implement an additional process that replaces line breaks in field values

hope for your understanding :-) regards, Mario

mariomuja avatar Nov 13 '20 12:11 mariomuja

@mariomuja, it' similar to this request: #204 (Remove colums during conversion). Your request may help me as well.

radoeka avatar Feb 16 '21 07:02 radoeka

The developer pushed a new commit, in which he added a "--no-line-breaks" option, it replaces line breaks with spaces. Please give it a try. PS: there is a similar argument available, called "--escape".

radoeka avatar Feb 17 '21 19:02 radoeka

The newly added argument "--no-line-breaks" works for me.

This issue can be closed.

radoeka avatar Feb 27 '21 09:02 radoeka

do not like this solution - not very nice to be forced to modify source data

instead of replacing line feeds by spaces, please allow us to set the escape character for the csv.writer call - then i can escape line feeds with whatever i like and later restore them to avoid deviations from the datasource; also see my new issue .. "--escape" is not very helpful, too

mariomuja avatar Apr 06 '21 08:04 mariomuja

I agree to mariomuja, I want to replace line breaks by the character \n. By the way then I could get rid of the quotes. Using the options "--escape" and "--quoting None" currently causes an exception.

christoph-ender avatar Jun 12 '23 14:06 christoph-ender