Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 03-29-2011, 07:37 PM   #1
ShinRa Actual
Junior Member
ShinRa Actual began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Mar 2011
Device: Nook
[Old Thread] Adding new column to sort by filename

Haven't found a simple explanation on how to do it anywhere; I want to be able to sort and navigate some of my books by their filename.
ShinRa Actual is offline   Reply With Quote
Old 03-29-2011, 08:21 PM   #2
Lady Fitzgerald
Wizard
Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.
 
Lady Fitzgerald's Avatar
 
Posts: 2,013
Karma: 251649
Join Date: Apr 2010
Location: Tempe, AZ, USA, Earth
Device: JetBook Lite (away from home) + 1 spare, 32" TV (at home)
Forgive me for asking but why?
Lady Fitzgerald is offline   Reply With Quote
Old 03-29-2011, 08:36 PM   #3
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by ShinRa Actual View Post
Haven't found a simple explanation on how to do it anywhere; I want to be able to sort and navigate some of my books by their filename.
You haven't found a simple explanation for this because as far as I can recall no one has ever asked for this feature.

If it can be done I'm sure someone will stop by and assist you in this effort.
DoctorOhh is offline   Reply With Quote
Old 03-30-2011, 03:25 AM   #4
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
I assume you're talking about the filename the files originally had? I know of no way to include that in the database in any way except through manual input. If you're talking about the file name of the book in the Calibre library, though, you could create a custom composite column with the template "{title} - {authors}", though you could just as easily just sort by title first and authors second.
Manichean is offline   Reply With Quote
Old 03-30-2011, 07:29 AM   #5
Lady Fitzgerald
Wizard
Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.
 
Lady Fitzgerald's Avatar
 
Posts: 2,013
Karma: 251649
Join Date: Apr 2010
Location: Tempe, AZ, USA, Earth
Device: JetBook Lite (away from home) + 1 spare, 32" TV (at home)
It seemed to me the OP was wanting to alter the database to maintain original filenames but until s/he responds back here, we won't really know.
Lady Fitzgerald is offline   Reply With Quote
Old 03-30-2011, 08:27 AM   #6
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by Lady Fitzgerald View Post
It seemed to me the OP was wanting to alter the database to maintain original filenames but until s/he responds back here, we won't really know.
You may be right but the OP did specifically state "Adding new column to sort by filename" in the thread title. Doesn't sound like a change to the database to me.

Setting the below tweak might accomplish what the OP wants by sorting the library upon start up.

Quote:
# Provide a set of columns to be sorted on when calibre starts # The argument is None if saved sort history is to be used
# otherwise it is a list of column,order pairs. Column is the
# lookup/search name, found using the tooltip for the column
# Order is 0 for ascending, 1 for descending
# For example, set it to [('authors',0),('title',0)] to sort by
# title within authors.

sort_columns_at_startup = ('authors',0),('series',0),('title',0)
The above sorts everything by author, with-in any author the series will be in series order and all other by author in alphabetical order.
DoctorOhh is offline   Reply With Quote
Old 03-30-2011, 08:56 AM   #7
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by Manichean View Post
I assume you're talking about the filename the files originally had? I know of no way to include that in the database in any way except through manual input.
When the file is first imported, if you allow Calibre to set metadata from filename, the entire filename is available to Calibre, and it could be sent in its entirety into the series field (or author/title, etc.). You'd need to correctly populate the author/title in a second step.

Alternately, you could shuffle the filename into comments with S&R, re-add the file correctly as a new record, do a merge of the two records to keep the filename metadata, etc. to get it all into a single record. I'm not sure it's worth all this effort, but it's at least possible to do it this way.

Last edited by Starson17; 03-30-2011 at 08:59 AM.
Starson17 is offline   Reply With Quote
Old 03-30-2011, 11:04 AM   #8
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Quote:
Originally Posted by Starson17 View Post
When the file is first imported, if you allow Calibre to set metadata from filename, the entire filename is available to Calibre, and it could be sent in its entirety into the series field (or author/title, etc.).
Ah, yeah, you're right. I didn't realize it could be done that way.
Manichean is offline   Reply With Quote
Old 03-30-2011, 11:35 AM   #9
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by Manichean View Post
I didn't realize it could be done that way.
But not very effectively, as there's no good way to use part of the filename twice. Once you've grabbed part of the filename as the title, you can't use that same portion of the filename as part of anything else.

I did consider writing an option checkbox to store the original filename into the comments field. I do occasionally like to keep track of where it came from, or need to keep bits of the filename like "author - title - (corrected version 1.2).txt" that don't fit anywhere else, but there wasn't much demand, and I found my own needs evolved to where I really didn't find much use for that "extra" info.
Starson17 is offline   Reply With Quote
Old 05-03-2011, 01:12 PM   #10
travger
Evangelist
travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.
 
travger's Avatar
 
Posts: 480
Karma: 270594
Join Date: Aug 2010
Device: palm tx, Windows7, Galaxy A5
Quote:
Originally Posted by Starson17 View Post
I did consider writing an option checkbox to store the original filename into the comments field. I do occasionally like to keep track of where it came from, or need to keep bits of the filename like "author - title - (corrected version 1.2).txt" that don't fit anywhere else, but there wasn't much demand, and I found my own needs evolved to where I really didn't find much use for that "extra" info.
I SO needed that when I first started with Calibre! And actually that's why I started new library - I just had no idea which pdf is which.
I think it would still be helpful, and there is lots of empty space on the second tab in metadata...
travger is offline   Reply With Quote
Old 05-03-2011, 02:02 PM   #11
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by travger View Post
I SO needed that when I first started with Calibre! And actually that's why I started new library - I just had no idea which pdf is which.
I think it would still be helpful, and there is lots of empty space on the second tab in metadata...
You might want to ask kiwidude in the plugins forum how hard it would be to add a plugin for this. It wouldn't surprise me if it would be fairly easy. There's no need to interface with the user. Alternatively, it could be implemented as a tweak option.

I regret that I don't have any spare time to implement this, but from my work on the automerge code I'm pretty sure this is not all that difficult to do. Calibre has the filename in its grasp during the add process and it's just a matter of concatenating it into comments along with the other metadata being filled in when the ebook is added.

The main problem is that this is most useful for a beginner who's just starting up by transferring an existing collection into calibre, and a beginner is never familiar enough with obscure calibre options to make much use of a feature like this.
Starson17 is offline   Reply With Quote
Old 05-03-2011, 02:36 PM   #12
travger
Evangelist
travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.
 
travger's Avatar
 
Posts: 480
Karma: 270594
Join Date: Aug 2010
Device: palm tx, Windows7, Galaxy A5
You are right in that, now when I'm bit more advenurous and have even .8 mode and several plugins, I've learned to accept the loss of the filename. On the other hand, adding those plugins was so easy. It is definitely worth asking, thanks.
travger is offline   Reply With Quote
Old 02-12-2012, 07:47 AM   #13
transmitthis
Addict
transmitthis ought to be getting tired of karma fortunes by now.transmitthis ought to be getting tired of karma fortunes by now.transmitthis ought to be getting tired of karma fortunes by now.transmitthis ought to be getting tired of karma fortunes by now.transmitthis ought to be getting tired of karma fortunes by now.transmitthis ought to be getting tired of karma fortunes by now.transmitthis ought to be getting tired of karma fortunes by now.transmitthis ought to be getting tired of karma fortunes by now.transmitthis ought to be getting tired of karma fortunes by now.transmitthis ought to be getting tired of karma fortunes by now.transmitthis ought to be getting tired of karma fortunes by now.
 
transmitthis's Avatar
 
Posts: 288
Karma: 1003542
Join Date: May 2011
Device: Google Nexus 7 16GB
Sorry to dig this up, but I have the same issue at present.
I really would like to be able to sort my library by file length
(Having issues with about 50books that are two long in their path length)

If a file name column, or a way to sort the library by lenght of title then I could easily find and edit those files.

As it is I'm left with creating a file list in windows (dir /b /s > c:\filelist.txt) and importing to Excel, then a "len" formula and sort, will get me a sorted list - but that still leaves me with a time consuming way to find and edit the files in Calibre.

Anyone had anymore thoughts on this.

Regarding another way to do what I want:
If anyone can help me with a Reg Expression in the search and replace metadata editing.
It seems all of my too long files are because of titles that include, sub titles ie
Here Comes Civilization: The Complete Science Fiction of William Tenn Volume II

Obviously that makes a long file name - even in the root of C:\
C:\14ThousandBooks\William Tenn\Here Comes Civilization: The Complete Science Fiction of William Tenn Volume II (10166)\Here Comes Civilization: The Complete
Science Fiction of William Tenn Volume II - William Tenn.mobi

All I need is a Reg Expression to search for ": " colon and space and any subsequent text and replace with nothing, I did try but Python is not my thing. Any takers?
transmitthis is offline   Reply With Quote
Old 02-12-2012, 08:31 AM   #14
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by transmitthis View Post
All I need is a Reg Expression to search for ": " colon and space and any subsequent text and replace with nothing, I did try but Python is not my thing. Any takers?
Use at own risk. I did a quick search on : in the search bar then selected 6 books with a : in their title to test the following.

Highlight your books in the library.
Open the Edit Metadata window.
Click on Search and Replace tab.
Search field: title
Search mode: Regular Expression
Search for: : .*
Replace with: leave blank
Destination field: title (or leave blank)
Click Apply

This worked for the six books I tested it on. YMMV.
DoctorOhh is offline   Reply With Quote
Old 02-12-2012, 08:46 AM   #15
transmitthis
Addict
transmitthis ought to be getting tired of karma fortunes by now.transmitthis ought to be getting tired of karma fortunes by now.transmitthis ought to be getting tired of karma fortunes by now.transmitthis ought to be getting tired of karma fortunes by now.transmitthis ought to be getting tired of karma fortunes by now.transmitthis ought to be getting tired of karma fortunes by now.transmitthis ought to be getting tired of karma fortunes by now.transmitthis ought to be getting tired of karma fortunes by now.transmitthis ought to be getting tired of karma fortunes by now.transmitthis ought to be getting tired of karma fortunes by now.transmitthis ought to be getting tired of karma fortunes by now.
 
transmitthis's Avatar
 
Posts: 288
Karma: 1003542
Join Date: May 2011
Device: Google Nexus 7 16GB

Just spent half an hour looking at python, I feel dizzy
I came up with this
(: )[a-z 0-9]*

Like yours much better dwanthny - thanks - will check it now.


Yep, that did the trick, simple when you know, but painful when you don't
did come across this one that gets rid of anything in () if anyone finds it useful
(\(.*\))

There should be a list of these somewhere, you know ones that are useful for book sorting

Last edited by transmitthis; 02-12-2012 at 08:49 AM.
transmitthis is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre: Read Filename into Custom Column juston Library Management 3 07-25-2019 12:34 AM
Adding a Sort column in main GUI handycam Calibre 11 12-21-2010 07:47 AM
Request Library to sort by filename and have search capabilities drwoood enTourage Archive 11 07-03-2010 06:09 PM
505: Is is possible to sort the book by FILENAME? Or to use FOLDERS? I get crazy drmaniac Sony Reader 6 10-18-2008 01:07 PM


All times are GMT -4. The time now is 08:18 PM.


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