05-13-2019, 02:09 AM | #1 |
Wizard
Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
|
Change Metadata in a Long Text Column
Hi.
I need some help creating a S&R if it's possible (or more than one). This is an example of what I want. This: Spoiler:
Needs to be changed to this: Spoiler:
It has to include all the html because otherwise FFF can't recognize it. I hope someone can help. |
05-13-2019, 09:59 AM | #2 |
hopeless n00b
Posts: 5,111
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
|
Unless someone's willing to take up the task of writing code to convert from plain text to HTML (probably via user-defined program which is a relatively significant undertaking) or you learn to program in python and do it yourself, converting from plain text directly to custom columns is easier.
e.g. Code:
Search field: #your_source_metadata_column Search for: Category: ([^\n]+) Replace with: \1 Destination field: #fandom Code:
Search field: #your_source_metadata_column Search for: Story URL: https://archiveofourown.org/works/([0-9]+) Replace with: \1 Destination field: #storyId |
Advert | |
|
05-13-2019, 10:36 AM | #3 |
Well trained by Cats
Posts: 29,812
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Yep! I was looking at that and going: Why aren't those values in individual Columns? (not a good plan if the 'columns' needed vary widely. Should be for a few 'well defined' uses)
BUT (I don't know how to write the code). Isn't most of what you want, what Convert from: TXT to: HTM or EPUB mostly does? Paste raw text into the comments (Normal view tab) , then switch to the HTML tab, and that will be wrapped in HTML tags (maybe not all what you want) Remember, sometimes it is way easier to break the task, int discrete processes. Make it HTMP. Parce it into 'fields'. Arrange (beautify) the fields |
05-13-2019, 12:09 PM | #4 |
hopeless n00b
Posts: 5,111
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
|
I expect the data was extracted from ebooks (maybe using MultiColumnSearch Full TXT search feature) that didn't have the actual metadata embedded (e.g. book has jacket/title page with the info but not in the OPF file).
It's not just converting to HTML. The id tags is the important part as it tells the FanFicFare plugin which data should go to specific custom columns. There's no way to automate that without writing your own function (or a very complicated regex) and without the ids, converting to HTML is pointless. Alas, manual editing to HTML might be doable for a few books. Not so much when you have to deal with hundreds or even thousands. @Tanjamuse Just a thought, extract just the StoryURL and let FanFicFare redownload. If any have been deleted, then just work on those separately. Code:
Search field: #your_source_metadata_column Search for: Story URL: (http[^\n]+) Replace with: \1 Destination field: #storyUrl |
05-13-2019, 12:34 PM | #5 |
Wizard
Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
|
All of them has been deleted, which is why I haven't got the saved metadata column that FFF creates.
|
Advert | |
|
05-13-2019, 05:52 PM | #6 |
null operator (he/him)
Posts: 20,583
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
There are HTML/Text Editors that support saved searches, regular expressions, and/or macro/plugin facility. They might not do what you want in bulk, but you might be able to fashion a 'Couple-of-Clicks' solution and do them one at time.
NoteTab is pretty good (sort of Sigil on Steroids). There comparison lists on Wikipedia. BR |
05-13-2019, 06:10 PM | #7 | |
hopeless n00b
Posts: 5,111
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
|
Quote:
Personally, I think it's simpler to run some Calibre saved search/replace than to do a whole lot of copy/paste to/from external programs in order to convert the text to something FanFicFare compatible, just so one can use the update metadata feature of FFF. |
|
05-13-2019, 06:26 PM | #8 | |
null operator (he/him)
Posts: 20,583
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Code:
Title : Quick Start Guide Title sort : Quick Start Guide Author(s) : John Schember [Schember, John] Languages : eng Timestamp : 2018-12-21T09:05:24+00:00 Published : 0101-01-01T00:00:00+00:00 Comments : calibre Quick Start Guide Read : Yes Added : Calibre's metadata paste will only operate on data created by calibre's metadata copy, but a calibre plugin should able to imitate that. BR Last edited by BetterRed; 05-13-2019 at 06:57 PM. |
|
05-14-2019, 04:18 AM | #9 |
Wizard
Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
|
It's 500+ stories that I need to do it with, which is why I had hoped for another solution than doing it manually. I ilovejedd's solution:
Code:
Search field: #your_source_metadata_column Search for: Category: ([^\n]+) Replace with: \1 Destination field: #fandom Spoiler:
|
05-14-2019, 10:26 AM | #10 | |
hopeless n00b
Posts: 5,111
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
|
Quote:
Code:
[\w\W]*Category: ([^\n<>]+)[\w\W]* For the above example, try the search code using Series: or Story URL: because it's not gonna find anything for Category:. |
|
05-14-2019, 10:35 AM | #11 |
Well trained by Cats
Posts: 29,812
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Regex has an OR Catagor([ies|y]) <done off the top o me head, I am traveling and my cheat sheets are home
|
05-14-2019, 10:44 AM | #12 | |
hopeless n00b
Posts: 5,111
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
|
Quote:
Code:
Language: Polski Le Fay Merlin (BBC) Packaged: 2017-10-09 11:59:51 |
|
05-14-2019, 10:47 AM | #13 |
Wizard
Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
|
I don't know what has happened with that column. I added the information from my txt-file to the metadata column (Long text, not shown in browser - like a comments column) and then tried the Regex ilovejedd posted earlier with the result posted above ending up in the fandom column. As far as I can see "Le Fay" is the author and not the fandom.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Browser Viewer: Long-text Custom Column | nqk | Server | 8 | 08-05-2018 08:25 AM |
Custom column long text toolbar | MerlinMama | Calibre | 2 | 03-01-2017 01:14 PM |
Annoyance - Column Type Long Text | BetterRed | Calibre | 4 | 08-28-2016 11:29 PM |
Custom yes/no column built from long text column | Philantrop | Library Management | 7 | 03-23-2013 07:44 PM |
No search/replace on custom long text column? | CWatkinsNash | Library Management | 2 | 06-20-2011 05:57 PM |