Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 10-17-2015, 07:35 PM   #1
loviedovie
Addict
loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.
 
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
loviedovie is offline   Reply With Quote
Old 10-17-2015, 08:40 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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:
Originally Posted by loviedovie View Post
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
Why not use Calc or Excel?
theducks is offline   Reply With Quote
Advert
Old 10-17-2015, 09:05 PM   #3
loviedovie
Addict
loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.
 
Posts: 295
Karma: 2139988
Join Date: Nov 2014
Device: bookeen
Quote:
Originally Posted by theducks View Post
Why not use Calc or Excel?
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.
loviedovie is offline   Reply With Quote
Old 10-17-2015, 09:31 PM   #4
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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.
eschwartz is offline   Reply With Quote
Old 10-17-2015, 11:29 PM   #5
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
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
PeterT is offline   Reply With Quote
Advert
Old 10-18-2015, 02:20 PM   #6
loviedovie
Addict
loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.
 
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.
loviedovie is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 04:34 PM.


MobileRead.com is a privately owned, operated and funded community.