![]() |
#1 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 126
Karma: 20236
Join Date: May 2014
Device: Kinde PW v1, Kobo H2O, Onyx Boox T68
|
Export catalog to Excel
Greetings
![]() I try to export my catalog to CSV (tried xml too) in order to import it into Excel. If I export "simple" columns like authors, title, series etc, no problem... But if I try to export with the "comments" column wich contains full of "", commas and CR/LF, the result can't be imported into Excel ! Can you help me, please ? Thanx in advance ![]() |
![]() |
![]() |
![]() |
#2 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,716
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@myki - Use the calibredb --list command - it will let you specify a sensible separator character - 'hat', 'bang' or 'snail' should be OK.
BR |
![]() |
![]() |
Advert | |
|
![]() |
#3 | ||
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 126
Karma: 20236
Join Date: May 2014
Device: Kinde PW v1, Kobo H2O, Onyx Boox T68
|
Thanx for your help BetterRed.
I tried this : Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#4 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,716
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@myki
Code:
calibredb list -f authors,title,series,series_index,comments --separator "¤" -w 1000000 > c:\testlist.csv Have a go with the suggested changes BR |
![]() |
![]() |
![]() |
#5 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Bugreport against the CSV output?
comma and CRLF in the field means it (field) should be quoted. literal quote character in a field should be represented by two consecutive quote characters. Do that and Excel should handle it just fine. Last edited by eschwartz; 03-15-2015 at 05:04 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,716
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@eschwartz - Good thinking. But right now that means editing the output file with a text editor - yes? BTW the OP isn't using a comma - is using a '¤'
@myki - you'll probably need to use a regular expression to wrap the text after fifth '¤' up until next '¤' in '"'. If needed someone like eschwartz can help you with that. You'll need to import the file into Excel using the Text Import Window so that you can tell Excel to use '¤' as a separator - you'll probably also want to set word wrap on the comments column BR |
![]() |
![]() |
![]() |
#7 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
I know what the OP was using as a separator
![]() Meantime, we shall see what can be done with "calibredb list", separately from what shoulda-coulda-woulda be with the catalog output. ![]() |
![]() |
![]() |
![]() |
#8 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,716
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
The CSV catalog desperately needs to allow the user to specify the separator, I think I may have requested that a long time ago - but the catalog dev never got back to me.
And for CSV at least, an option to not create a Book in the library. Flashback - CSV catalogs and lost souls ![]() BR |
![]() |
![]() |
![]() |
#9 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
By the way, regarding calibredb list outputting weird stuff -- that would be because the solution will involve parsing json outputted by calibredb list --for-machine.
![]() |
![]() |
![]() |
![]() |
#10 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,487
Karma: 78910112
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
Load it into LibreOffice's spreadsheet. Seems to work like a charm there.
I do remember Dalton stressing in one of his plugins that a required CSV file HAD to be made by LO due to Excel having problems with Unicode documents. |
![]() |
![]() |
![]() |
#11 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,339
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Excel's default CSV import is a bit of a joke. For instance, the delimiter it uses depends on the locale!
You need to use the Text Import wizard to get excel to do it properly, see for instance: http://blogmines.com/blog/how-to-imp...in-excel-2013/ |
![]() |
![]() |
![]() |
#12 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Huh, so really it works just fine?
![]() @PeterT -- DaltonST only said Excel apparently cannot export proper UTF-8, which apparently his plugin needs. No word on it having fundamentally better understanding of CSV -- though Kovid indicates the issue may just be the import settings? I know LibreOffice pops up the import wizard all the time... Well, gosh darn it all! ![]() |
![]() |
![]() |
![]() |
#13 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,339
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
As far as I know, the csv output works just fine. All fields are quoted and all quotes inside fields are doubled. It is Excel that has issues. See line 155 of csv_xml.py
|
![]() |
![]() |
![]() |
#14 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Looks good then.
Whoops, all that overreaction for naught. ![]() |
![]() |
![]() |
![]() |
#15 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 126
Karma: 20236
Join Date: May 2014
Device: Kinde PW v1, Kobo H2O, Onyx Boox T68
|
Thank you for your help everybody
![]() It seems like Excel isn't able to deal with the quotes ! So I followed your advice and used LibreOffice, and it worked at first attempt, without doing anything on the csv file directly issued of Calibre ! When the content of the comments field starts with a quote, when a field is empty (resulting with "" in the csv file), Excel is lost ! Just for the fun I tried the calibre-db list command with the ¤ as a separator and with all fields, and it worked directly in Excel, but the result is less clear than in OpenOffice (like all the html tags in the comments field, or the tags in the form [u'tag1',u'tag2'] etc...). Conclusion : In my opinion, nothing has to be changed in the way the catalog export is done in CSV format, but a new txt export format could be developped, offering the choice of the separator and the surrounding field character. Anyway, thank you for this wonderfull program... and its comunity ![]() (sorry for my bad english too) |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre - Export/Import Settings and Catalog | joseph.voros | Library Management | 4 | 06-13-2014 11:19 PM |
Export list to excel? | Belle2Be | Library Management | 7 | 01-15-2014 06:14 AM |
Select books based on info from Conversion > Export Catalog | halfcore | Library Management | 2 | 10-22-2013 06:15 PM |
mobi catalog = periodical, ePub catalog = book | trekchick | Library Management | 7 | 03-12-2011 01:11 PM |
Export Catalog *and* the stored cover? | Hitch | Library Management | 2 | 02-24-2011 10:50 PM |