Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#383 closed defect (fixed)

WFSFilterBuilder - CSV Output with multiline text bugged in MS Excel

Reported by: belug Owned by: adube
Priority: major Milestone: 1.4.0
Component: widgets Version: trunk
Keywords: WFSFilterBuilder cvs excel Cc: belug

Description

When importing a CSV file, with multiline text, made by the WFSFilterBuilder in MS Excel Excel replace the new line in thext by a new line in the table causing sooooo much trouble with the rest of the line.

I have also tested in libreOffice Calc and it's OK.

Here's some info about the bug and a possible way of correction :

http://stackoverflow.com/questions/2668678/importing-csv-with-line-breaks-in-excel-2007

Attachments (3)

Change History (15)

comment:1 by belug, 12 years ago

I've played with other CSV and I had the same issue. I replaced the "\n" for "\r\n" and it was resolved. Tryed in UTF-8 and ISO-8859-1.

comment:2 by belug, 12 years ago

What I said last is false, it is ok if you open it directly with Excel, but if you import as external data it still fail to add new lines in the cells.

comment:3 by belug, 12 years ago

I must add that Excel is buggy on that.. i've created a test CSV with Excel and some multiline and while importing the data from it it was wrong too...

Failed on Excel XP, Excel 2003, 2007 and 2010.

After a some searches there some other software that doesn't support multiline CSV but in the big ones OpenOffice and LibreOffice do support it.

comment:4 by belug, 12 years ago

This patch optionnaly remove the support for multiple line csv value in string and replace the newline character for the string placed in the parameter.

This add an option to the service. Please check the modified documentation for more information.

Please review.

comment:5 by belug, 12 years ago

This file correct the bug if you did not enter the csvSeperatorChar option

comment:6 by adube, 12 years ago

(1) If the csvSeperatorChar option is ommited, then it would throw an exception. This is the default behavior of the Service->getOption method. See here :

http://trac.osgeo.org/geoprisma/attachment/ticket/383/383-B-wfsfilterbuilder-csv-output-multilines.diff

If you want to have a "false" value returned, then set the second argument to true ($pbSkipError)


(2) csvSeperatorChar -> csvSeparatorChar

comment:8 by belug, 12 years ago

This one as the correct behavior, thanks adube for pointing the getOption parameter.

comment:9 by adube, 12 years ago

Looks good. Please, commit.

Thanks for the patch.

comment:10 by adube, 12 years ago

belug, could you please see that this was fixed in trunk and is ready for 1.4 ?

comment:11 by belug, 12 years ago

Resolution: fixed
Status: newclosed

Fixed in r1370

comment:12 by adube, 12 years ago

r1373, WFSReadProxy small PHPSniffer fix.

Note: See TracTickets for help on using tickets.