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 01-22-2019, 10:50 PM   #1
StickyC
Junior Member
StickyC began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Feb 2008
Device: Kindle
Extract Pubdate from imported Magazines

I have a slew of periodicals that I've imported that are in the general format of
Title: Title - YYYY Mmm
(for instance MagPi - 2017 October)

I'm trying to figure out how (if there's a way) to use Edit Metadata In Bulk to parse the titles, extract the date info (via RegEx) and insert it into the PubDate field for each title.

Is this possible? I've had zero luck so far with a wide variety of options on the Search and replace dialog in Edit meta information.

Thanks!
StickyC is offline   Reply With Quote
Old 01-23-2019, 02:33 AM   #2
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
I started with:

Search field: title
Search for:
Code:
.*- (\d+) (\w{3}).*
Replace with: \2 \1
Destination field: pubdate

And that worked (though I didn't try all months). Then I thought to try:

Search field: title
Search for:
Code:
.*- (\d+) (\w+)
Replace with: \2 \1
Destination field: pubdate

And it worked as well.

But, the simplest is:

Search field: title
Search for:
Code:
.*- (.*)
Replace with: \1
Destination field: pubdate

None of these would handle a second dash in the title. And it will fail if the month is misspelt.
davidfor is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
pubdate from nomefile raffabelli Library Management 0 05-04-2017 07:57 AM
Calibre 2.70 - {pubdate} is 1 year off DrChiper Calibre 2 10-14-2016 08:39 AM
Pubdate in catalogs BetterRed Calibre 0 09-03-2013 01:54 AM
Set pubdate by script Pete69 Library Management 3 07-05-2013 10:35 AM
Extract Pubdate Martin Hollander Calibre 10 01-10-2013 08:30 AM


All times are GMT -4. The time now is 07:48 AM.


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