Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 04-08-2018, 10:04 AM   #16
compurandom
Guru
compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.
 
Posts: 919
Karma: 417282
Join Date: Jun 2015
Device: kobo aura h2o, kobo forma
If you use regex, .* matches everything in the source.
If you use (.*) then it also saves that in a group parameter, so the first () can be retrieved in the replacement box with \1 and the second one with \2 etc...

so if you wanted to do something fancier than just copying the value, you could.

For a silly example, if you wanted to insert the old series in the middle of the date, you could use these values:

template: {:'format_date(raw_field('pubdate'), 'yyyyMM')'}{series_index}
search for: (....)(..)(.*)
replace with: \1-\3-\2

And this would put the series index between the year and month...not that I think this is useful or anything but silly...

And the above example probably wouldn't work because it's no longer a number with the dashes, but yes, if you want to set the series, you'd set destination to series index.
compurandom is offline   Reply With Quote
Old 04-08-2018, 12:11 PM   #17
theducks
Well trained by Cats
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: 29,792
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
if you want only 2 DIGITS trapped first, then (\d\d)(\d\d\d)(\d\d\d\d)
I avoid using the wildest card (.*) when possible
theducks is offline   Reply With Quote
Old 04-11-2018, 01:01 AM   #18
American_Desi
Connoisseur
American_Desi began at the beginning.
 
Posts: 72
Karma: 10
Join Date: Oct 2016
Device: iPad Pro 12.9"
THANK YOU!

I got it to work with all the suggestions you gave. For reference, in case anyone has the same problem, this is what I did based on your input:

Search field: {template}
Template: {:'format_date(raw_field('pubdate'), 'yyyyMM')'}
Search for: (\d\d)
Replace with: \1
Destination field: series_index

Using this search/replace function (which I saved), the Series Index gets changed to a number derived from the Publication Date in YYYYMM format. This allows me to put all my different Marvel Comics in chronological order (by publication date) which will best approximate the "in-universe" reading order (though I imagine I will have to make some modifications manually for cross-over story arcs).

Thanks again for all your help!
American_Desi is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
bulk meta data editing aardbewoner Library Management 4 12-29-2016 04:39 PM
Regex help: Edit Meta Search & Replace: Pad with zero _noel_ Calibre 4 11-26-2012 04:31 PM
series and meta data Toxaris Calibre 2 02-07-2011 02:08 AM
error when editing meta data tom233 Calibre 1 10-06-2010 03:28 AM
Editing author and title meta data jflatto Calibre 16 06-24-2010 05:41 PM


All times are GMT -4. The time now is 05:41 AM.


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