Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 02-03-2023, 05:41 AM   #1
Doum
Enthusiast
Doum began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jun 2020
Device: Kobo Aura HD
program move from "publisher" to a new column with conditions

Hi,
There no second series column possibility, so before I know the existing of "custum column" I used "publisher" to store my reference "SN <number>" but only in some specifics books

But now, I want to create a new custum column (SN) and use this number only if the format "SN [0-9][0-9][0-9][0-9]" exist in my publisher's column
(and also remove/replace this name in publisher)

Do you think it's possible? (with search&replace ?)

A program like that
create a new column SN
for each ebook in my library
do
If regex publisher tag is like SN [0-9][0-9][0-9][0-9]
then
copy the number in the SN column
replace publisher column with "Gallimard"
else
donothing
fi
done

Example SN 0345 (string in publisher column) ==> 345 (number in SN column )

THanks for your suggestions (and sorry for my English)

PS : my first idea was to create a SQL scripts directly on the sqllite (metadata) but it's very risky. I prefere using internal command if it(s possible

Last edited by Doum; 02-03-2023 at 06:07 AM.
Doum is offline   Reply With Quote
Old 02-03-2023, 08:30 AM   #2
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: 28,440
Karma: 48895676
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2, K4NT(Fixed: New Bat.), Galaxy Tab A
No program needed.
Bulk mode of Metadata edit: Search and replace)
I would do this on pre-filtered (search results) selections

2 passes on the selected records
Search: SN (\d{4})
Pass 1 copies the captured number int the destination
Dest: \1

Pass 2 changes the {Publisher} to the new value
dest: Gallimard
theducks is offline   Reply With Quote
Old 02-04-2023, 05:04 AM   #3
Doum
Enthusiast
Doum began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jun 2020
Device: Kobo Aura HD
Thanks the ducks , i will do that
Doum is offline   Reply With Quote
Old 02-04-2023, 07:26 AM   #4
Doum
Enthusiast
Doum began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jun 2020
Device: Kobo Aura HD
Just one more question .
As you can see on the image file , the filter is correctly applicated but it takes also others formats in the destination ?
How to applied ONLY SN (\d{4})

search&replace take action on rows where the filter it's not applicated ... strange . the "do_nothing" in my if/then/else doesn't work

Thanks for your help

Exemple : if publisher is "Flammarion" you will have in Series2 Flammarion!!! It should be empty
Attached Thumbnails
Click image for larger version

Name:	SN.png
Views:	24
Size:	33.4 KB
ID:	199467   Click image for larger version

Name:	sn2.png
Views:	23
Size:	51.3 KB
ID:	199469  

Last edited by Doum; 02-05-2023 at 04:36 AM. Reason: message says it
Doum is offline   Reply With Quote
Old 02-04-2023, 10:35 AM   #5
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: 28,440
Karma: 48895676
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2, K4NT(Fixed: New Bat.), Galaxy Tab A
That image site is NASTY and is trying to trick users into installing FAKE updates. I am removing the link.
MR allows attachments. Switch to advanced and use the paperclip icon
theducks is offline   Reply With Quote
Old 02-06-2023, 03:52 AM   #6
Doum
Enthusiast
Doum began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jun 2020
Device: Kobo Aura HD
Hi,
do you confirm its's not possible in search&replace to not take action on lines outside filter ?

In the documenttaion https://manual.calibre-ebook.com/function_mode.html
it's possible to used function mode in search&replace ???

Last edited by Doum; 02-06-2023 at 04:44 AM.
Doum is offline   Reply With Quote
Old 02-06-2023, 10:31 AM   #7
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: 28,440
Karma: 48895676
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2, K4NT(Fixed: New Bat.), Galaxy Tab A
I confirm nothing that I do not control.

S&R works on what is selected. Get that right, then the S&R screen should show samples of what it will do on the right. Be sure to scroll.

OH
Anytime you do a bulk S&R you should FIRST do a FULL BACKUP (you should do backups regularly in case you have other problems and keep one off site, where a similar disaster will not get it.)
theducks is offline   Reply With Quote
Old 02-06-2023, 01:30 PM   #8
Doum
Enthusiast
Doum began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jun 2020
Device: Kobo Aura HD
what kind of error ?

Thanks for your answer

Yes it does the job on all selected rows but it's also copy all not selected rows in my columns #series2 form publishers as you can see on the image SN3.png

The filter it's not exclusive

And after i aplied, the result it's on SN4.png with wrongs results

So if it's should works as you said, i made a mistake .
Perhaps on the result field, a special syntaxe ?!?
Attached Thumbnails
Click image for larger version

Name:	sn3.png
Views:	29
Size:	82.0 KB
ID:	199536   Click image for larger version

Name:	sn4.png
Views:	20
Size:	13.8 KB
ID:	199537  

Last edited by Doum; 02-06-2023 at 01:38 PM.
Doum is offline   Reply With Quote
Old 02-06-2023, 02:14 PM   #9
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: 28,440
Karma: 48895676
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2, K4NT(Fixed: New Bat.), Galaxy Tab A
You did not First use The Library Search to only select books that start with:
publisher:~SN (\d{4})
Then use Bulk mode to do the move
theducks is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading time by creating a column with "word count"/"your wpm" Anyssia Calibre 2 01-04-2019 01:02 PM
Custom column for "Volume" and "Version" (Revision) BaronKrause Library Management 10 11-02-2017 09:20 PM
Apple Mac now have a file extension ".iba" for the program "iBooks Author." brucehobson Calibre 3 09-15-2014 07:46 PM
Custom column: "Updated date", when adding new "versions" of the same file? enriquep Library Management 16 11-03-2011 10:46 AM
Commercial program says it can "make your own pdf e-books" - Anyone know about " Fugubot PDF 3 04-29-2009 06:39 PM


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


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