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 01-04-2019, 08:50 AM   #1
Inukami
Zealot
Inukami began at the beginning.
 
Inukami's Avatar
 
Posts: 116
Karma: 10
Join Date: Jun 2017
Location: Australia
Device: Mac OS X, iPad Mini 4, iPhone 6, iBooks, Kindle for Mac & PC
Question Automatically capitalise the first letter of tags when downloaded as metadata?

Is it possible to automatically capitalise the first letter of tags when they are downloaded as metadata? And also automatically capitalise the first letter of any tags in general?

I thought you could do this through preferences and create rules to filter/transform tags, but not sure what to use for regex pattern.

Preferences > Create rules to filter/transform tags > add rule >

Upper-case the tag, if it does not match pattern: ?

Thanks,

Inukami
Inukami is offline   Reply With Quote
Old 01-04-2019, 10:49 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 34,540
Karma: 11409410
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
use a pattern that matches any tag, such as

.+
kovidgoyal is offline   Reply With Quote
Advert
Old 01-05-2019, 04:30 AM   #3
Inukami
Zealot
Inukami began at the beginning.
 
Inukami's Avatar
 
Posts: 116
Karma: 10
Join Date: Jun 2017
Location: Australia
Device: Mac OS X, iPad Mini 4, iPhone 6, iBooks, Kindle for Mac & PC
Quote:
Originally Posted by kovidgoyal View Post
use a pattern that matches any tag, such as

.+
Thanks for your response Kovid.

Not sure what you mean by the .+

Can I literally put the following in?

Upper-case the tag, if it matches a pattern: .+?

Thanks,

Inukami
Inukami is offline   Reply With Quote
Old 01-05-2019, 05:55 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 34,540
Karma: 11409410
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
yes, but note that uppercase will make the entire tag uppercase.
kovidgoyal is offline   Reply With Quote
Old 01-05-2019, 06:57 AM   #5
Inukami
Zealot
Inukami began at the beginning.
 
Inukami's Avatar
 
Posts: 116
Karma: 10
Join Date: Jun 2017
Location: Australia
Device: Mac OS X, iPad Mini 4, iPhone 6, iBooks, Kindle for Mac & PC
If upper-case will make the entire tag uppercase/capital letters, what is the difference between upper-case and capitalize?

I only want the first letter of each tag to be capitalised, so the upper-case won't work for me if it capitalises the entire tag...

I suppose another option would be to Search and Replace if I want all the tags to have a capital letter on the first letter?

Thanks,

Inukami
Inukami is offline   Reply With Quote
Advert
Old 01-05-2019, 10:25 AM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 34,540
Karma: 11409410
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
capitalise is first letter capital. Upper case is all letters capital
kovidgoyal is offline   Reply With Quote
Old 01-09-2019, 08:39 AM   #7
Inukami
Zealot
Inukami began at the beginning.
 
Inukami's Avatar
 
Posts: 116
Karma: 10
Join Date: Jun 2017
Location: Australia
Device: Mac OS X, iPad Mini 4, iPhone 6, iBooks, Kindle for Mac & PC
Quote:
Originally Posted by kovidgoyal View Post
capitalise is first letter capital. Upper case is all letters capital
Thanks for that. I have capitalised and it all seems to be working except occasionally it seems to miss one. It also doesn't work with tags that are two words like Science Fiction as it only capitalises the first letter obviously.

One more question on search and replace. People have said that if you use Search and Replace, make sure you backup as you can't undo it. Why is that? Can't you just reverse the Search and Replace which would literally undo it and put it back where it originally came from?

Inukami
Inukami is offline   Reply With Quote
Old 01-09-2019, 09:58 AM   #8
jhowell
Wizard
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 2,865
Karma: 26337727
Join Date: Nov 2011
Location: Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
Quote:
Originally Posted by Inukami View Post
One more question on search and replace. People have said that if you use Search and Replace, make sure you backup as you can't undo it. Why is that? Can't you just reverse the Search and Replace which would literally undo it and put it back where it originally came from?
No you can't in general. For example, if you screw up and change every tag to "Fiction" then you can't restore the original by changing "Fiction" back to the many different tags that you had originally.
jhowell is online now   Reply With Quote
Old 01-09-2019, 11:11 AM   #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: 23,272
Karma: 24326584
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: K4NT, Galaxy Tab A, Kobo Aura2
You want Titlecase , not Capitalize (first letter)

Also. Almost every case tools I have used (incl Calibre) wants lowercase to start with (will not lower letters if all caps)

Note: bulk use of case tools can muck up specific tags with proper names or roman numerals
theducks is offline   Reply With Quote
Old 01-09-2019, 04:20 PM   #10
Inukami
Zealot
Inukami began at the beginning.
 
Inukami's Avatar
 
Posts: 116
Karma: 10
Join Date: Jun 2017
Location: Australia
Device: Mac OS X, iPad Mini 4, iPhone 6, iBooks, Kindle for Mac & PC
jhowell and theducks, thanks for your input.

I will make sure I backup if I do any major searches and replaces.

Quote:
Originally Posted by theducks View Post
You want Titlecase , not Capitalize (first letter)

Also. Almost every case tools I have used (incl Calibre) wants lowercase to start with (will not lower letters if all caps)

Note: bulk use of case tools can muck up specific tags with proper names or roman numerals
Calibre doesn't seem to have the option to Titlecase tags, but yes that would be ideal.

I haven't run into that problem yet with bulk use of case tools and don't have any roman numerals in these tags that I wanted to use titlecase for. So should be okay for now.

Usually the download feature isn't too bad for my books. It sometimes has way to many when I import though, although gives me a good idea where to start.

Inukami
Inukami is offline   Reply With Quote
Old 01-09-2019, 05:20 PM   #11
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 13,618
Karma: 10793754
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Inukami View Post
<snip>

One more question on search and replace. People have said that if you use Search and Replace, make sure you backup as you can't undo it. Why is that? Can't you just reverse the Search and Replace which would literally undo it and put it back where it originally came from?
Reversing regular expression S&R's isn't necessarily simple or even possible - the advice stems from users making irreversible mistakes and not having a backup - often of any kind.

IMO a casing tool should offer the following at least:

Titlecase - A star is born
Propercase - A Star is Born
Capitalcase - A Star Is Born
Lowercase - a star is born
Uppercase - A STAR IS BORN

BR

Last edited by BetterRed; 01-09-2019 at 05:33 PM.
BetterRed is offline   Reply With Quote
Old 01-09-2019, 06:32 PM   #12
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: 23,272
Karma: 24326584
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: K4NT, Galaxy Tab A, Kobo Aura2
Quote:
Originally Posted by Inukami View Post
jhowell and theducks, thanks for your input.

I will make sure I backup if I do any major searches and replaces.



Calibre doesn't seem to have the option to Titlecase tags, but yes that would be ideal.

I haven't run into that problem yet with bulk use of case tools and don't have any roman numerals in these tags that I wanted to use titlecase for. So should be okay for now.

Usually the download feature isn't too bad for my books. It sometimes has way to many when I import though, although gives me a good idea where to start.

Inukami
It does from inside the MDE. Find a book with a bunch of wrong case.: Open the MDE on it: Right click: Select case: save
That 1 operation affect all usage of those tags.
A bit of a PITA, but it does get the job done
theducks is offline   Reply With Quote
Old 01-09-2019, 06:42 PM   #13
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 13,618
Karma: 10793754
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by theducks View Post
It does from inside the MDE. Find a book with a bunch of wrong case.: Open the MDE on it: Right click: Select case: save
That 1 operation affect all usage of those tags.
A bit of a PITA, but it does get the job done
Maybe the case change tool could be made available in the Manage Categories edit box for Tag, Publisher, Series etc. It would facilitate doing occasional eyeball checks on all values.

BR

Last edited by BetterRed; 01-09-2019 at 06:57 PM. Reason: typo
BetterRed is offline   Reply With Quote
Reply

Tags
calibre, capitalise, metadata, regex, tags

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre fills automatically title and author metadata in books without any metadata? thosedays Library Management 5 10-28-2016 03:33 PM
How to customize tags from downloaded metadata Mindful Library Management 7 06-03-2016 10:47 AM
Set (user defined) metadata for downloaded news automatically mjost Library Management 0 03-10-2013 11:45 AM
Automatically populating metadata "tags" field from directory structure battaglia01 Calibre 1 12-13-2012 09:23 PM
Regular expression to capitalise the first letter of a word Ahmad Samir Sigil 0 10-23-2010 02:33 AM


All times are GMT -4. The time now is 12:37 PM.


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