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 10-18-2021, 07:39 AM   #1
srv181
Member
srv181 began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Aug 2014
Device: Galaxy Note 8
Extract author from title field?

So sorry to ask, but my programming days were 40 years ago. Many .pdf's I import don't have the author in the correct field, instead it is in the title, for instance "Agriculture The Food We Grow and Animals We Raise (Natural Resources) by Julie Kerr Casper".
Right now I have to
go to each title,
cut text starting with "by" to the end of the title,
wait for the edited title to store,
enter the author column
paste the authors name
return to beginning of the field
delete "by "

Please, please don't tell me to study the template language - I'm happy to make an appropriate donation for a solution to the problem - see screen-clip.
Many thanks!
Attached Thumbnails
Click image for larger version

Name:	author in title.jpg
Views:	116
Size:	106.5 KB
ID:	189683  
srv181 is offline   Reply With Quote
Old 10-18-2021, 08:14 AM   #2
mbovenka
Wizard
mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.
 
Posts: 2,044
Karma: 13579113
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
Quote:
Originally Posted by srv181 View Post
Please, please don't tell me to study the template language - I'm happy to make an appropriate donation for a solution to the problem - see screen-clip.
Many thanks!
I would start with something like (in Edit Metadata (in bulk) -> Search and replace):

Search field: Title

Search for: \(.*\) by \(.*\)

Replace with: \2

Destination field: Author

Note that this will not take any 'by' in the Title into account, so it's very basic.

Assuming this worked, you can do the same with Replace with: \1 and Destination field: Title to update the title.

Again, test whether it does what you want, this is off the top of my head. You will have to fix the author field yourself afterwards (thing like commas instead of & and stuff like that).
mbovenka is online now   Reply With Quote
Advert
Old 10-20-2021, 10:38 AM   #3
srv181
Member
srv181 began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Aug 2014
Device: Galaxy Note 8
Quote:
Originally Posted by mbovenka View Post
I would start with something like (in Edit Metadata (in bulk) -> Search and replace):

Search field: Title

Search for: \(.*\) by \(.*\)

Replace with: \2

Destination field: Author

Note that this will not take any 'by' in the Title into account, so it's very basic.

Assuming this worked, you can do the same with Replace with: \1 and Destination field: Title to update the title.

Again, test whether it does what you want, this is off the top of my head. You will have to fix the author field yourself afterwards (thing like commas instead of & and stuff like that).
Thanks for your reply, unfortunately, now I have the whole text string in both the title and the authors fields and need to:
- delete the authors from the title
- delete the title from the authors
oh well, it may still be quicker than simple cut and paste and edit. I'll give it a try with more than 1 title
srv181 is offline   Reply With Quote
Old 10-20-2021, 04:46 PM   #4
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,935
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
If you swap the Author & Title columns, then you could
  • press F2 on the Title,
  • cut the 'by <Author Name>' text with Ctrl+X,
  • tab into Author,
  • paste the 'by <Author Name>' with Ctrl+V,
  • cut the 'by ',
  • press enter.
BR
BetterRed is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch edit Author in title field? andyse7en Calibre 1 09-03-2020 10:50 AM
Can Someone Give me the Code Needed to Extract Title/Author From Added Books? rebeltaz Library Management 8 07-27-2019 05:10 PM
Splitting <title> - <author> in Title field zamana Library Management 14 06-22-2015 11:40 AM
remove author from title field er0_senn1n Calibre 2 09-30-2012 04:50 PM
Reg ex to move 'by author' from title field maartencoertjens Library Management 3 10-20-2011 04:26 PM


All times are GMT -4. The time now is 03:20 AM.


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