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 10-27-2022, 10:57 PM   #1
Rellwood
Library Breeder (She/Her)
Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.
 
Rellwood's Avatar
 
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...
Rellwood is offline   Reply With Quote
Old 10-28-2022, 12:47 AM   #2
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
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:
\|\d+; 
Then replace with nothing.
Karellen is offline   Reply With Quote
Advert
Old 10-28-2022, 11:23 AM   #3
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
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 ;?
DNSB is offline   Reply With Quote
Old 10-28-2022, 04:13 PM   #4
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: 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
Quote:
Originally Posted by DNSB View Post
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 ;?
or
;* (0 or more)
theducks is offline   Reply With Quote
Old 11-19-2022, 02:41 PM   #5
Rellwood
Library Breeder (She/Her)
Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.
 
Rellwood's Avatar
 
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.
Rellwood is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
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


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


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