![]() |
#1 |
Library Breeder (She/Her)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,268
Karma: 1937891
Join Date: Apr 2015
Location: Fullerton, California
Device: Paperwhite 2015 (2), PW 2024 (12 GEN), PW 2023 (11 GEN), Scribe (1st)
|
Regex Help Please??
I use Ablebits Excell add-ons to help with my Goodreads Library Export csv which I format and using import list, get my current shelves and other info up to date. I also use a small .exe file I got from GitHub that is a Goodreads CSV extender which after pointing it to a recent Goodreads export it will chug away and tack on to the end of each row all the genres (popular shelves) and dates read (multiple dates) for each book.
So between those two things I get spectacular data to enter into Calibre. However, I just realized that I was deleting some numbers that I needed. This is how the genres are displayed at the end of the row: Horror|470;Fiction|73;Thriller|21;Science Fiction|9;Audiobook|8;Animals|6;European Literature,British Literature|5;Fantasy|5;Novels|5;Apocalyptic,Post Apocalyptic|4 The numbers represent the number of people who shelved the book with that genre. With Ablebits I was just mass formatting the column by deleting all the numbers and the "|" and find/replace the semicolons and commas. It turns out that I was deleting all the 15th Century, 16th Century, etc. and leaving ",th Century" behind. Ablebits has a regex function to find and remove substrings within a cell. So I would like to know if there is a regex expression that would include all the numbers between that "|" and a semicolon. Sorry so long... |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,611
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
This should find the pipe, digits and semi-colon
PHP Code:
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,243
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
I would suggest replacing with a ; instead of nothing. Perhaps leaving the ; out to allow catching the last item in the list which is not terminated by a ;?
|
![]() |
![]() |
![]() |
#4 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,062
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
![]() |
![]() |
![]() |
#5 |
Library Breeder (She/Her)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,268
Karma: 1937891
Join Date: Apr 2015
Location: Fullerton, California
Device: Paperwhite 2015 (2), PW 2024 (12 GEN), PW 2023 (11 GEN), Scribe (1st)
|
The reason I get rid of the ; is because I transform it into a coma.
What starts out as Horror|470;Fiction|73;Thriller|21;Science Fiction|9;Audiobook|8;Animals|6;European Literature,British Literature|5;Fantasy|5;Novels|5;Apocalyptic,Post Apocalyptic|4 Ends up as Horro, Fiction.Thriller, Science Fiction, Audiobook, Animals, European Literature.British Literature, Fantasy, Novels, Apocalyptic.Post Apocalyptic I have heriarchal shelves. The steps for formatting have been: Delete numbers (single step) Delete the divider Find/Replace , to . Find/Replace ; to , Last edited by Rellwood; 11-19-2022 at 02:44 PM. |
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
pdf regex question - regex that wraps to a new line | flyash | Conversion | 1 | 09-05-2021 09:00 AM |
Predefined regex for Regex-function | sherman | Editor | 3 | 01-19-2020 05:32 AM |
regex help | najgori | Workshop | 8 | 01-22-2014 11:06 AM |
Regex | Gunnerp245 | Conversion | 5 | 03-05-2012 04:15 PM |
Help with a regex | A.T.E. | Calibre | 1 | 04-05-2010 07:50 AM |