View Single Post
Old 10-02-2010, 04:28 PM   #8
kacir
Wizard
kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.
 
kacir's Avatar
 
Posts: 3,463
Karma: 10684861
Join Date: May 2006
Device: PocketBook 360, before it was Sony Reader, cassiopeia A-20
Quote:
Originally Posted by dkritso109 View Post
see my dilemma??? can anyone give me an expression that most closely extracts the relevant data i need into the metadata card?
At this very moment I do it this way:
- When I need to process a few books, I do it manually, with Drag & Drop of the book, then I press E and use icons next to title, name, author to swap some words.
- when I have many books to import, especially when they are just files with name of book in a directory that has author name, I make listing of all files (on Linux) it is like
Code:
cd ~/BooksToProcess
find . -type f > copybooks.sh
on Windows you would use something like dir /R/B > copybooks.bat

Then I open copybooks.sh in Gvim text editor and I massage it with Regular-Expresion-Fu until I get something like
Code:
cp '~/BooksToProcess/Armstrong, Kelley/Otherworld/ 1 - Bitten' '~/ImportTempDir/Kelley Armstrong - Otherworld 1 - Bitten'
then I import books into Calibre in bulk.

Another solution with the newest Calibre would be to import the books as they are, and then process Authors field using Regular Expressions with backreferences.
So:
Select books
Right click, select Bulk Edit Metadata
go to Search and Replace
select Search mode Regular Expressions
Search for ([^,]*), (.*)
Replace expression \2 \1
and, of course select Search Field and Destination Field "authors"

DO NOT FORGET TO MAKE BACKUP OF THE LIBRARY BEFORE ATTEMPTING SOMETHING LIKE THIS
kacir is offline   Reply With Quote