Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delimiter not auto-detected correctly when quoted fields contains more than one new line char #681

Open
konuch opened this issue Jun 17, 2019 · 2 comments

Comments

@konuch
Copy link
Contributor

konuch commented Jun 17, 2019

When trying to auto-detect the delimiter from following line:
Field1;Field2;"F\ni,e,l,d\n,3"
it wrongly guesses the delimiter as COMMA instead of SEMICOLON, even if the field with new line and comma is quoted.

Tested on demo site: https://www.papaparse.com/demo

Expected behavior would be that the guessing logic correctly takes a quoted string as a field and would not consider its characters when guessing the delimiter, even if they contain new line: ["Field1", "Field2", "F↵i,e,l,d↵,3"]

PS. Escaping the new line char within the quoted field is not an option in our business case.

@pokoli
Copy link
Collaborator

pokoli commented Jun 29, 2019

Could you test this is fixed on current master? #687 may have fixed this.

@paustint
Copy link

paustint commented Jul 1, 2019

@pokoli - I think I am having a related issue and I just tested on the master branch with no luck. I tried to remove new line characters, but the error still occurs - so I think my issue is completely unrelated.

On the demo website, it detects the column as ; when it should be ,.

If I set the delimiter in the parsing options to , or change the file's delimiter to ; then it parses without any problems.

CSV:

Id,HtmlValue
00X3B000000pnAIUAY,"<table border=""0"" cellpadding=""5"" width=""800"" cellspacing=""5"" height=""400"" >
<tr valign=""top"" height=""400"" >
<td tEditID=""c1r1"" style="" background-color:#FFFFFF; color:#000000; bEditID:r3st1; bLabel:main; font-size:12pt; font-family:arial;"" aEditID=""c1r1"" locked=""0"" >
<![CDATA[<font face=""Arial, sans-serif"" style=""font-family: arial;"" size=""2"" color=""#333333""><b style="""">Thank you for your business. The following order was received by our Order Management System.</b></font><div style=""""><font size=""2"" style=""color: rgb(0, 0, 0);""><b><br></b></font><div style=""color: rgb(0, 0, 0); font-family: arial;""><font face=""Arial, sans-serif"" style="""" size=""2"">Please note, you will receive a separate notification email with links to software downloads and license keys.</font></div><div style=""color: rgb(0, 0, 0); font-family: arial;""><font face=""Arial, sans-serif"" style="""" size=""2""><br></font></div><div style=""font-family: arial;""><font face=""Arial, sans-serif"" style="""" size=""2""><b style=""""><font color=""#333333"">Finance Order #:</font>&nbsp;</b></font><font face=""Arial, sans-serif"" size=""2"" style=""color: rgb(0, 0, 0);"">{!Order.Finance_Order_Number__c}</font></div><div style=""font-family: arial;""><font face=""Arial, sans-serif"" style="""" size=""2""><b style=""""><font color=""#333333"">Customer PO:</font></b>&nbsp;</font><font face=""Arial, sans-serif"" size=""2"" style=""color: rgb(0, 0, 0);"">{!Order.PO_Number__c}</font></div><div style=""font-family: arial;""><font face=""Arial, sans-serif"" style="""" size=""2""><b style=""""><font color=""#333333"">Sales Rep:</font></b>&nbsp;</font><font face=""Arial, sans-serif"" size=""2"" style=""color: rgb(0, 0, 0);"">{!Order.Sales_Rep__c}</font></div><div style=""font-family: arial;""><font face=""Arial, sans-serif"" style="""" size=""2""><b style=""""><font color=""#333333"">Estimated Ship Date:</font></b>&nbsp;</font><font face=""Arial, sans-serif"" size=""2"" style=""color: rgb(0, 0, 0);"">{!Order.Estimated_Ship_Date__c}</font></div><div style=""font-family: arial;""><font face=""Arial, sans-serif"" style="""" size=""2"" color=""#333333""><br></font></div><div style=""font-family: arial;""><font face=""Arial, sans-serif"" style="""" size=""2"" color=""#333333""><b style="""">Ship To:</b></font></div><div style=""color: rgb(0, 0, 0); font-family: arial;""><span style=""font-family: Arial, sans-serif;""><font size=""2"">{!Order.Ship_To_Address__c}</font></span></div><div style=""font-family: arial;""><span style=""font-family: Arial, sans-serif;""><font color=""#333333"" size=""2""><br></font></span></div><div style=""font-family: arial;""><font face=""Arial, sans-serif"" style="""" size=""2"" color=""#333333""><b style="""">Bill To:</b></font></div><div style=""color: rgb(0, 0, 0); font-family: arial;""><span style=""font-family: Arial, sans-serif;""><font size=""2"">{!Order.Bill_To_Address__c}</font></span></div><div style=""color: rgb(0, 0, 0); font-family: arial;""><span style=""font-family: Arial, sans-serif;""><font size=""2""><br></font></span></div><div style=""""><font size=""2""><span style=""font-family: Arial, sans-serif;""><b style=""""><font color=""#333333"">End Customer:</font></b>&nbsp;</span><font face=""Arial, sans-serif"" style=""color: rgb(0, 0, 0);"">{!Order.Account_Name1__c}</font></font></div><div style=""color: rgb(0, 0, 0);""><font face=""Arial, sans-serif"" size=""2""><br></font></div><div style=""color: rgb(0, 0, 0);""><font face=""Arial, sans-serif"" size=""2"">{!Order.Flattened_Lines__c}</font></div><div style=""color: rgb(0, 0, 0); font-family: arial;""><font face=""Arial, sans-serif"" style="""" size=""2""><br></font></div><div style=""color: rgb(0, 0, 0); font-family: arial;""><font face=""Arial, sans-serif"" style="""" size=""2"">PLEASE NOTE:</font></div><div style=""color: rgb(0, 0, 0); font-family: arial;""><font face=""Arial, sans-serif"" style=""color: rgb(0, 0, 0);"" size=""2"">(1) If you notice any discrepancies in the above information, please contact&nbsp;</font><font face=""Arial, sans-serif"" size=""2"" style=""color: rgb(0, 0, 0);""><a href=""mailto:[email protected]"" style="""">[email protected]</a>&nbsp;</font><font face=""Arial, sans-serif"" size=""2"">immediately.</font></div><div style=""color: rgb(0, 0, 0); font-family: arial;""><font face=""Arial, sans-serif"" size=""2"">(2) This email is NOT an acceptance to your order; acceptance of your order may be subject to credit or other conditions. foo may accept your order by shipping the requested products or by a separate written notice.</font></div><div style=""color: rgb(0, 0, 0); font-family: arial;""><font face=""Arial, sans-serif"" size=""2"">(3) If your order is accepted by foo, acceptance is subject only to foo's standard terms and conditions (available at&nbsp;</font><font face=""Arial, sans-serif"" size=""2""><span style=""color: rgb(77, 77, 77);"">at </span><a href=""www.foo.com"" style="""">www.foo.com</a>). If a written agreement is signed by both you and foo is in effect, then acceptance is subject only to the terms of the signed agreement.</font></div><div style=""color: rgb(0, 0, 0); font-size: 12pt; font-family: arial;""><font face=""Arial, sans-serif"" style="""" size=""2""><br></font></div></div>]]></td>
</tr>
</table>"

image

the data looks like this:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants