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

Bug report to my blog #10

Closed
bobbysmith007 opened this issue Feb 15, 2013 · 5 comments
Closed

Bug report to my blog #10

bobbysmith007 opened this issue Feb 15, 2013 · 5 comments
Assignees

Comments

@bobbysmith007
Copy link
Member

I’m getting the error: “we are reading non quoted csv data and found a quote at 1″
no matter what I do. SBCL on windows xp (yeah, yeah, laugh all you want, tell my boss).
I know the data is quoted, I want it to be quoted, quote is set correctly, so is always-quote so why does it think it’s non quoted

@ghost ghost assigned bobbysmith007 Feb 15, 2013
@bobbysmith007
Copy link
Member Author

If you could provide me with more information it would certainly help us track down what is going wrong.
The 1 in the error message implies that it was the second character of a csv-line that caused this issue. It should have printed the line in question (the one causing the error) below that message. Seeing the data that caused the error would be very useful.

More generally, this error message is generated when cl-csv detects that we have started reading unquoted data, but then encountered a quote. EG: ab"cde","fg","hi",jk would cause this error because it read ab which it interpreted as the start of unquoted data, and then encountered a quote.

@bobbysmith007
Copy link
Member Author

I guess that since I have been unable to duplicate this bug, and have received no feedback about it, that I will close this.

@analyticd
Copy link

I got this error too. One of the columns that I have in my data can have the double quote as an inches specifier and this causes the error. How do you overcome this? In this particular case, the column delimiter is #\Tab so you wouldn't expect it to give special meaning to a double quote anyway. Please advise.

@bobbysmith007 bobbysmith007 reopened this Jan 4, 2017
@bobbysmith007
Copy link
Member Author

This behaviour is controlled by *quote-escape* and *escape-mode* which defaults to "". If you can upload a minimal failing csv, I can debug and add a test case for this. AFAIK, this works and its tested by test-csv1. By column delimiter do you mean *separator*? If you do not have any *quote* in the document you could set quote to some random unused character (perhaps #\nul) otherwise it expects there to be quoted values.

Here is a test I wrote that shows this working:

(defparameter +test-tab-csv-issue-10+ "id	inches	name
1	72\"	Russ Tyndall
2	67\"	Amy Bobanolis
")

(define-test issue-10-tab-csv (:tags '(parsing bugs whitespace empty-line))
  (let* ((csv (read-csv +test-tab-csv-issue-10+ :quote #\nul :separator #\tab))
         (row1 (second csv)))
    (assert-equal "72\"" (second row1) csv)))

@analyticd
Copy link

Thanks! :quote #\nul did the trick

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

2 participants