![]() |
Need Help With "Regular Expression Syntax"
Hey all,
I am seriously confused with Regular Expression Syntax. All of my file names are like this: ---------------------------------------------------------------------------------------- Single Books: Armstrong, Kelley - Jaurķa Book Series: Armstrong, Kelley - Otherworld 1 - Bitten ---------------------------------------------------------------------------------------- Calibre does not pick up any information at all from these filenames, the title nor the author. Can someone please forward me a syntax that works for this type of file name system? |
There's a tutorial available in Calibre's user manual.
|
Quote:
Armstrong, Kelley - Otherworld 1 - Bitten so I get author name Kelley Armstrong I can extract author, title, series, even make series optional(*), yet I haven't found a way of how to parse (LastName, FirstName|Firstname Lastname) to the {authors} field. (*) I *think*, because I found one unpleasant limitation in python RE engine used to parse names in calibre |
see my dilemma??? can anyone give me an expression that most closely extracts the relevant data i need into the metadata card?
|
You could always extract the lastname, firstname into {authors} and fix it up with search & replace later. Other than that, off the top of my head, I can't think of any solution.
|
i have literaly thousands of books in that format, we are talking like a month's work of copy and pasting. i have gone over the tutorial with no avail.
|
Quote:
Code:
(.*?),\s(.*?)Code:
\2 \1 |
Quote:
- 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 ~/BooksToProcessThen 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'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 |
Quote:
|
wow, i think i'm gonna take a perl programming class at the local community college just so i can figure out a regular expression that works! or just pay a teenager minimum wage to go file by file and input them the way i want. don't know which way would be cheaper yet.
|
Quote:
|
yeah you guys are awesome thanks, i been going over it for hours and hours now. i could've read a few books by now. will continue to try and i'll post back with an update. thanks again, also if anyone does figure it out hit me up.
|
Quote:
|
i still can't get the author to load from FN,LN to LN,FN. from what i have gathered i have to go back and redo them with search and replace correct? that is where i am still lost.
|
Quote:
|
| All times are GMT -4. The time now is 06:07 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.