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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 10-20-2011, 12:37 PM   #1
maartencoertjens
Member
maartencoertjens began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Aug 2011
Device: Kindle
Reg ex to move 'by author' from title field

Hi

I am very new to regular expressions but found a lot of useful info here so adding books is much more succesful now. I have however a lot of books that are already in the library and that still have in the title field: title by author> For example The rhyme of the ancient mariner by Coleridge. I have been editing them one by one but got bite tired of that
And therefore am hoping that there is any easy way to do search and replace with regex.

Thanks a lot!

Maarten
maartencoertjens is offline   Reply With Quote
Old 10-20-2011, 01:21 PM   #2
theducks
Grand Sorcerer
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: 14,702
Karma: 5643657
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by maartencoertjens View Post
Hi

I am very new to regular expressions but found a lot of useful info here so adding books is much more succesful now. I have however a lot of books that are already in the library and that still have in the title field: title by author> For example The rhyme of the ancient mariner by Coleridge. I have been editing them one by one but got bite tired of that
And therefore am hoping that there is any easy way to do search and replace with regex.

Thanks a lot!

Maarten
It takes 2 passes.
First sets the Author. Second cleans the title of the
by author

the image shows the first setting
Not check the test cases for correctness

for the second pass, change the destination to Title
AND the replace with to \1 (the stuff before the by

View the TEST results carefully. (a full backup of your Library would not be out of order ) before committing.

Doing this wrong
Attached Thumbnails
Click image for larger version

Name:	split on by.jpg
Views:	88
Size:	40.0 KB
ID:	77994  
theducks is online now   Reply With Quote
 
Enthusiast
Old 10-20-2011, 03:07 PM   #3
maartencoertjens
Member
maartencoertjens began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Aug 2011
Device: Kindle


Worked well for most of them but for some reason did not want to work for:
- The Murderers Confessed By Mabel Abbott
- Erick and Sally, by Johanna Spyri, Translated

In the second example it is probably because of the comma's but no clue why the first doesn't work

Maarten
maartencoertjens is offline   Reply With Quote
Old 10-20-2011, 04:26 PM   #4
theducks
Grand Sorcerer
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: 14,702
Karma: 5643657
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by maartencoertjens View Post


Worked well for most of them but for some reason did not want to work for:
- The Murderers Confessed By Mabel Abbott
- Erick and Sally, by Johanna Spyri, Translated

In the second example it is probably because of the comma's but no clue why the first doesn't work

Maarten
Capital B (the REGEX is case sensitive)
theducks is online now   Reply With Quote
Reply

Tags
regexp

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Author field help CraftingGrandma Library Management 11 09-09-2011 09:58 PM
How tho change the author name field Poldi Calibre 2 08-11-2011 01:37 PM
Changing the title field when sending to the Kindle Cheezykins Devices 3 06-19-2011 09:14 AM
How to make Author field empty? khutch Calibre 1 08-14-2009 02:12 PM
Changing from Title-Author to Author - Title Amalthia Calibre 15 09-22-2008 08:41 PM


All times are GMT -4. The time now is 06:40 PM.


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