Summary: | Item Search csv export | ||
---|---|---|---|
Product: | Koha | Reporter: | Joy Nelson <1joynelson> |
Component: | Searching | Assignee: | Galen Charlton <gmcharlt> |
Status: | RESOLVED DUPLICATE | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | didier.gautheron, josef.moravec, magnus, p.thrasher |
Version: | 3.22 | ||
Hardware: | All | ||
OS: | All | ||
See Also: | http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14263 | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: | What is seen in Excel when opening the csv |
Description
Joy Nelson
2015-05-07 17:35:46 UTC
I don't have Excel, but I can't see any problem with the contents of the file based on eyeballing it in a text editor. Does this problem exist in more recent versions? If so, please update this bug's version information. Created attachment 52653 [details]
What is seen in Excel when opening the csv
And here is the corresponding data from the .csv file. Note the stray quotes. "The new atlas of the stars : Mellinger, Axel.", "2005", "Firefly Books,", "", "31951001323440", "QB65 .M4513 2005", "WESSELS LIBRARY", "WESSELS LIBRARY", "ATLAS", "", "", "0" "Atlas of the world / ", "2005", "Published in North America by Oxford University Press,", "", "31951001324620", "G1021 .G4125 2005 MAP", "WESSELS LIBRARY", "WESSELS LIBRARY", "ATLAS", "", "", "0" "Atlas of the world / ", "2005", "Published in North America by Oxford University Press,", "", "31951001324638", "G1021 .G4125 2005", "WESSELS LIBRARY", "WESSELS LIBRARY", "ATLAS", "", "", "0" "HarperCollins atlas of the Bible / ", "1997", "HarperCollins,", "", "31951001398350", "G2230 .H35 1997", "WESSELS LIBRARY", "WESSELS LIBRARY", "ATLAS", "", "", "0" (In reply to Joy Nelson from comment #3) > Created attachment 52653 [details] > What is seen in Excel when opening the csv I don't see any stray quotes. All quotes look like they are matched correctly. However, I do see that publisher data is getting split incorrectly. I would think that Excel would ignore a common within double quotes, but it looks like it doesn't. I thought I would try exporting a report containing title, author, and publisher to see if the resulting CSV file had the same structure and found that the CSV file saved doesn't use commas at all, it uses semicolons. I wonder if that's why those exports work for you. Does this problem happen for you in versions > 3.18.x? If so, please update this bug's version information. Yes, sorry, I meant stray commas. It is the publisher that is getting out of whack and Excel is not smart enough to ignore the comma inside double quotes. grrr And Excel is rarely my spreadsheet of choice. But for some libraries it is what they are required to use. ;-) (In reply to Owen Leonard from comment #5) > I don't see any stray quotes. All quotes look like they are matched > correctly. However, I do see that publisher data is getting split > incorrectly. I would think that Excel would ignore a common within double > quotes, but it looks like it doesn't. > > I thought I would try exporting a report containing title, author, and > publisher to see if the resulting CSV file had the same structure and found > that the CSV file saved doesn't use commas at all, it uses semicolons. I > wonder if that's why those exports work for you. > > Does this problem happen for you in versions > 3.18.x? If so, please update > this bug's version information. For Excel its's probably better to set the CSV separator to semicolons - set system preference delimiter and choose the semicolons also in CSV profiles, if you are using them... I am closing as invalid, as it's rather on Excel side than Koha side... Feel free to reopen it, if you have an idea what we could do on Koha side. The issue is the spaces before the double quotes. Original from Koha: "Starry night : Macomber, Debbie.", "2013", "Ballantine Books,", "", "34505003358304" produces these fields (each field in a subsequent column): Starry night : Macomber, Debbie. "2013" "Ballantine Books , ", 34505003358304" Removing spaces before double quotes results in: "Starry night : Macomber, Debbie.","2013","Ballantine Books,","","34505003358304" which produces these fields: Starry night : Macomber, Debbie. 2013 Ballantine Books, 34505003358304 It seems that there isn't a universal standard for CSV files, but https://en.wikipedia.org/wiki/Comma-separated_values says: According to RFC 4180, spaces outside quotes in a field are not allowed; however, the RFC also says that "Spaces are considered part of a field and should not be ignored." and "Implementors should 'be conservative in what you do, be liberal in what you accept from others' (RFC 793, section 2.10) when processing CSV files." 1997, "Ford" ,E350 Reports that are downloaded from Koha in CSV format do not have the extra space. Can this code use the same functions as reports? |