![]() |
#1 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 295
Karma: 2139988
Join Date: Nov 2014
Device: bookeen
|
Formatting calibredb list?
Hi
Is it possible to format calibredb list output? I am trying to get 2nd and the 3rd column with awk but I am getting all kinds of weird cuts, so maybe the output is not using tabs? I am not sure . I am using somehting along this calibre_list |awk '{print $2,$4;}' My understanding of awk is limited so maybe i am doing it wrong. thanks |
![]() |
![]() |
![]() |
#2 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,001
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
|
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 295
Karma: 2139988
Join Date: Nov 2014
Device: bookeen
|
Well I am trying to script some functionality (sorting, searching multiple libraries etc) so that I do not use gui apps.
Last edited by loviedovie; 10-17-2015 at 09:16 PM. |
![]() |
![]() |
![]() |
#4 |
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)
|
`calibredb list` has a --for-machine option that will output JSON, which is going to be your best option for scripting.
The default, human-readable output shapes itself to the output terminal and isn't meant to be programmatically parsed. Any decent programming language should have a way to parse JSON. For bash, you will have to use something like jshon. ![]() Last edited by eschwartz; 10-17-2015 at 09:36 PM. |
![]() |
![]() |
![]() |
#5 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,446
Karma: 78880114
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
See https://github.com/step-/JSON.awk for JSON handling in AWK
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 295
Karma: 2139988
Join Date: Nov 2014
Device: bookeen
|
Hi everyone
Thanks for all the solutions. I will see what I can do with them. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
calibredb list --for-machine | mjrival | Library Management | 3 | 05-04-2015 03:39 PM |
calibredb list --with-library | bverspeiser | Calibre | 2 | 08-10-2012 04:50 AM |
calibredb list question | mezme | Calibre | 3 | 01-01-2012 09:22 PM |
calibredb list | iomari | Calibre | 9 | 10-12-2011 11:30 AM |
calibredb list no subseries_index | reup | Library Management | 5 | 10-11-2011 10:32 AM |