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 02-15-2015, 02:12 PM   #1
zamana
Zealot
zamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfolded
 
zamana's Avatar
 
Posts: 133
Karma: 52836
Join Date: Feb 2012
Location: São Paulo / Brazil
Device: Kindles: Touch, Voyage, Oasis 9th, Oasis 10th / Kobo: Libra Colour
Splitting <title> - <author> in Title field

Hi!

Some time ago I imported around 10 thousand books in one of my libraries. Half of the books <title> - <author> in the field Title, and "Unknown" in the field Author.

How do I split <title> - <author> in order to fix the metadata?

Thanks.
Regards.

Last edited by zamana; 02-15-2015 at 02:21 PM. Reason: Grammar.
zamana is offline   Reply With Quote
Old 02-15-2015, 03:04 PM   #2
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
When importing them, there is an option in Preferences ==> Adding books
Uncheck "Read metadata from file contents rather than file name" and calibre will use the regex in the bottom half of that window to derive metadata from the filename.
eschwartz is offline   Reply With Quote
Advert
Old 02-15-2015, 03:09 PM   #3
zamana
Zealot
zamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfolded
 
zamana's Avatar
 
Posts: 133
Karma: 52836
Join Date: Feb 2012
Location: São Paulo / Brazil
Device: Kindles: Touch, Voyage, Oasis 9th, Oasis 10th / Kobo: Libra Colour
Hi!

Thanks for reply, but that's the problem: the books are already imported, and I don't have the original files anymore.

Should I remove and re-import the books in the library? Is this the easiest path?

Thanks.
Regards.
zamana is offline   Reply With Quote
Old 02-15-2015, 03:13 PM   #4
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
For the future, do that. For the books already imported, you can do the same trick to copy information from column to column using Bulk Edit Metadata, last tab (Search and Replace).
Make sure to choose regex mode.
eschwartz is offline   Reply With Quote
Old 02-15-2015, 03:19 PM   #5
zamana
Zealot
zamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfolded
 
zamana's Avatar
 
Posts: 133
Karma: 52836
Join Date: Feb 2012
Location: São Paulo / Brazil
Device: Kindles: Touch, Voyage, Oasis 9th, Oasis 10th / Kobo: Libra Colour
That was my first approach, but I simply don't know how to use this resource for my needs...

I'll study the Calibre docs a little.

Thanks.
Regards.

Last edited by zamana; 02-15-2015 at 03:31 PM.
zamana is offline   Reply With Quote
Advert
Old 02-15-2015, 03:25 PM   #6
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Search title:
Code:
([^-]) - ([^-])
Replace author:
Code:
\2
Apply

Search title:
Code:
([^-]) - ([^-])
Replace title:
Code:
\1
eschwartz is offline   Reply With Quote
Old 02-15-2015, 03:30 PM   #7
zamana
Zealot
zamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfolded
 
zamana's Avatar
 
Posts: 133
Karma: 52836
Join Date: Feb 2012
Location: São Paulo / Brazil
Device: Kindles: Touch, Voyage, Oasis 9th, Oasis 10th / Kobo: Libra Colour
Hummm, almost there...

The result is joining <title><author>

See the attachment, please.

Thanks!
Attached Thumbnails
Click image for larger version

Name:	calibre_replace.png
Views:	426
Size:	44.9 KB
ID:	134887  
zamana is offline   Reply With Quote
Old 02-15-2015, 03:33 PM   #8
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
I am a monumental idiot. This time, we will repeat the character sets...


Search title:
Code:
([^-]+) - ([^-]+)
Replace author:
Code:
\2
Apply

Search title:
Code:
([^-]+) - ([^-]+)
Replace title:
Code:
\1
eschwartz is offline   Reply With Quote
Old 02-15-2015, 03:38 PM   #9
zamana
Zealot
zamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfoldedzamana reads XML... blindfolded
 
zamana's Avatar
 
Posts: 133
Karma: 52836
Join Date: Feb 2012
Location: São Paulo / Brazil
Device: Kindles: Touch, Voyage, Oasis 9th, Oasis 10th / Kobo: Libra Colour
Are you what!?!?! I can't disagree more!

You saved my day!

This time your RegEx worked fantastically!

Thank you very much for teaching me.
Best regards.
zamana is offline   Reply With Quote
Old 02-15-2015, 03:45 PM   #10
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Well, I certainly made a monumentally stupid oversight.
So when I give myself a virtual slap and call myself stupid, hopefully I remember next time to not overlook that...
Happy to help, though -- now that I am no longer in monumentally-stupid mode.

I hope the rest of your day remains as good.
eschwartz is offline   Reply With Quote
Old 06-21-2015, 03:43 PM   #11
krizso
Junior Member
krizso began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jun 2015
Device: Kindle Paperwhite
Almost the same problem

Hi!

I've tried to use your methods to split tile and author fields. The only difference is in my case:
<author> ; <title>

The separator is ";" not the "-".

I've tried a several changes in the regexp but none of them working. Could you please help???

Thank you very much!
krizso is offline   Reply With Quote
Old 06-21-2015, 06:32 PM   #12
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Swapping out the "-" for ";" -- just the middle separator, not the bit in the character sets.

Search title:
Code:
([^-]+) ; ([^-]+)
Replace author:
Code:
\2
Apply

Search title:
Code:
([^-]+) ; ([^-]+)
Replace title:
Code:
\1

For more about the wild and wonderful world of regex, check out this website: http://www.regular-expressions.info
Taught me (most) everything I know. Worth a look.
eschwartz is offline   Reply With Quote
Old 06-22-2015, 02:40 AM   #13
krizso
Junior Member
krizso began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jun 2015
Device: Kindle Paperwhite
Yes, just as I've thought, but it is nothing happend.
Attached Thumbnails
Click image for larger version

Name:	Calibre_metadata.png
Views:	330
Size:	39.3 KB
ID:	139500  
krizso is offline   Reply With Quote
Old 06-22-2015, 02:44 AM   #14
krizso
Junior Member
krizso began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jun 2015
Device: Kindle Paperwhite
Done

It's a little mistake:

([^-]+); ([^-]+)



Thank you!
krizso is offline   Reply With Quote
Old 06-22-2015, 11:40 AM   #15
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
That would be because there is no space between the author and the ";" -- but at first you said:

Quote:
Originally Posted by krizso View Post
[...] The only difference is in my case:
<author> ; <title>

The separator is ";" not the "-".
Regexes require great accuracy.
Glad you got it working.
eschwartz is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing from Title-Author to Author - Title Amalthia Calibre 17 01-22-2017 11:20 PM
the <dc:title>field ? cybmole ePub 2 01-31-2014 11:13 AM
remove author from title field er0_senn1n Calibre 2 09-30-2012 04:50 PM
Copy data from Title field to IDs field rlh3 Library Management 9 09-24-2012 08:12 AM
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 07:30 AM.


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