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

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 05-20-2012, 02:55 PM   #1
Themus
Zealot
Themus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-books
 
Posts: 117
Karma: 998
Join Date: Apr 2010
Device: Nook
Sigil Proper Case Setting

I understand someday Sigil will have a feature where sentences can be converted to uppercase, lowercase and propercase, just like we can do now to make text bold, or italic.

I had found a free "cut and paste" utility that would allow me within Sigil to change text case. Now I cannot find it and I am hoping someone here would remember it.

I am not familiar with Regex everyone mentions.

I have a book with lot of subheadings that are in Upper case and I wish to change them to upper and lower. The utility I referenced above would cut the text via control -x and then put in back with control -v, but now in proper case.

Anyone remember or see that utility?

Tom
Themus is offline   Reply With Quote
Old 05-20-2012, 03:43 PM   #2
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 9,531
Karma: 43837842
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Not really Sigil related, but perhaps it's one of the ones listed in this Best Free Clipboard Replacement Utility review site?.
DiapDealer is offline   Reply With Quote
Old 05-20-2012, 04:52 PM   #3
Themus
Zealot
Themus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-books
 
Posts: 117
Karma: 998
Join Date: Apr 2010
Device: Nook
Thank you. I saw those, though it didn't seem any automatically would change the case, but instead would use an editor. I did find one that works rather well. CaseChanger.
Themus is offline   Reply With Quote
Old 05-20-2012, 06:23 PM   #4
alansplace
Wizard
alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.
 
alansplace's Avatar
 
Posts: 4,060
Karma: 47167382
Join Date: Feb 2010
Location: USA, 33.938556° N, -117.271334° W
Device: Kindles 2, KB, PW 1, PW 2, Voyage, & Fire 2 -- iPad mini
Cool Dolphin Text Editor

Quote:
Originally Posted by Themus View Post
I understand someday Sigil will have a feature where sentences can be converted to uppercase, lowercase and propercase, just like we can do now to make text bold, or italic.

I had found a free "cut and paste" utility that would allow me within Sigil to change text case. Now I cannot find it and I am hoping someone here would remember it.

I am not familiar with Regex everyone mentions.

I have a book with lot of subheadings that are in Upper case and I wish to change them to upper and lower. The utility I referenced above would cut the text via control -x and then put in back with control -v, but now in proper case.

Anyone remember or see that utility?

Tom
Dolphin Text Editor
alansplace is offline   Reply With Quote
Old 05-23-2012, 07:26 AM   #5
GrannyGrump
Persnickity Nitpicker
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 570
Karma: 2673214
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
I have a little autohotkey script I made that works in most any text editor, including Sigil (not in Word or any other app that has that feature built-in).

I wrote it to do Case changes on selected text with double-tap of CapsLock Key, use hotkeys to add curly quotes around selected text, add certain code tags around selected text, double-right-click to copy, triple-right-click to paste. (lots more too).
It runs in the background, accessed from the system tray.

I've only ever used it in XP SP3, but if anybody is interested, I can upload it. I can even compile it into a tiny exe file, if that is preferred.
GrannyGrump is offline   Reply With Quote
Old 05-23-2012, 10:06 AM   #6
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 2,124
Karma: 4861354
Join Date: Dec 2010
Device: Kindle PW2
The Sigil PCRE library already supports conversion to upper case and lower case with \U, \u, \L and \l back references.

For example:

Find: <p>(.*?)</p>
Replace: <p>\U\1\E</p>
Before:
Code:
<p>This is a test sentence.</p>
After:
Code:
<p>THIS IS A TEST SENTENCE.</p>
Find: <h3>([[:upper:]])([[:upper:]]{2,})
Replace: <h3>\1\L\2
Before:
Code:
<h3>CHAPTER 1</h3>
After:
Code:
<h3>Chapter 1</h3>
Find: <p>(.*?)</p>
Replace: <p>\u\1</p>
Before:
Code:
<p>this is a test sentence.</p>
After:
Code:
<p>This is a test sentence</p>
These back references are also useful for Project Gutenberg texts with all caps text instead of italics. For example:

Find: ([[:upper:]]{2,})
Replace: <i>\L\1\E</i>
Before:
Code:
<p>This should be in ITALICS.</p>
After:
Code:
<p>This should be in <i>italics</i>.</p>

Last edited by Doitsu; 09-26-2012 at 05:03 AM.
Doitsu is offline   Reply With Quote
Old 05-23-2012, 11:01 AM   #7
Jabby
Jr. - Junior Member
Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.
 
Posts: 581
Karma: 2000358
Join Date: Aug 2010
Location: East Texas
Device: Archos, Asus, HP, Lenovo, Nexus and Samsung tablets in 7,8 and 10"
Quote:
Originally Posted by Doitsu View Post
The Sigil PCRE library already supports conversion to upper case and lower case with \U, \u, \L and \l back references.
Thanks. This will be handy;

However, I don;t understand the difference between \U and \u or \L and \l. Could you help?

Thanks - John
Jabby is offline   Reply With Quote
Old 05-23-2012, 11:23 AM   #8
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 2,124
Karma: 4861354
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Jabby View Post
However, I don;t understand the difference between \U and \u or \L and \l.
\u and \l transform only one character, while \U and \L transform all characters. Have a look at the third example in my previous post.
Doitsu is offline   Reply With Quote
Old 05-23-2012, 12:14 PM   #9
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 9,531
Karma: 43837842
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Doitsu View Post
while \U and \L transform all characters. Have a look at the third example in my previous post.
All characters until it encounters \E.
Notice how your closing </p> tag was also capitalized in the initial example?
DiapDealer is offline   Reply With Quote
Old 05-23-2012, 12:55 PM   #10
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 2,124
Karma: 4861354
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by DiapDealer View Post
All characters until it encounters \E.
Notice how your closing </p> tag was also capitalized in the initial example?
Nice catch. I updated the replace string in the first example. And yes, I know that the second search string isn't textbook either, but I wanted to keep it simple.

Last edited by Doitsu; 05-23-2012 at 04:53 PM.
Doitsu is offline   Reply With Quote
Old 05-23-2012, 01:08 PM   #11
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 9,531
Karma: 43837842
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Doitsu View Post
And yes, I know that the second search strings isn't textbook either, but I wanted to keep it simple.
I hadn't even noticed. I just knew (from screwing things up myself) that forgetting the \E can have some ugly/unexpected consequences... especially with complicated and/or extensive replace strings.
DiapDealer is offline   Reply With Quote
Old 05-23-2012, 04:17 PM   #12
Jabby
Jr. - Junior Member
Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.
 
Posts: 581
Karma: 2000358
Join Date: Aug 2010
Location: East Texas
Device: Archos, Asus, HP, Lenovo, Nexus and Samsung tablets in 7,8 and 10"
Quote:
Originally Posted by Doitsu View Post
\u and \l transform only one character, while \U and \L transform all characters. Have a look at the third example in my previous post.
Thanks again.

Just used it to change chapter headers from "CHAPTER ONE / CHAPTER THIRTY-FOUR" to "Chapter One / Chapter Thirty-Four".

Three step process but fast and easy.

This is what you call instant gratification.

Regards - John
Jabby is offline   Reply With Quote
Old 04-25-2013, 06:54 PM   #13
dwlamb
Member
dwlamb began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Apr 2013
Device: Android Smartphone
how do I capitalise more than two words in a string

I have a very long list of words that are all in capitals and it is necessary to change them to title case. For instance:
Code:
<li>DOG HOUSE</li>
needs to be
Code:
<li class="small-caps">Dog House</li>
The search string
Code:
<li>([A-Z])([A-Z]*)</li>
will find
Code:
<li>DOG</li>
<li>CAT</li>
<li>BIRD</li>
and replace them as I want using this replace syntax
Code:
<li class="small-caps">\1\L\2</li>
The list items I am searching on in come cases are as many as 5 words. Is there a method of RegEx to accomplish this or am I asking too much of this tool?
dwlamb is offline   Reply With Quote
Old 04-26-2013, 03:55 AM   #14
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 3,182
Karma: 7180223
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
You can try:

search: <li>(.*?)</li>
replace: <li class="small-caps">\1</li>
Toxaris is offline   Reply With Quote
Old 04-26-2013, 04:47 AM   #15
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 2,124
Karma: 4861354
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Toxaris View Post
You can try:

search: <li>(.*?)</li>
replace: <li class="small-caps">\1</li>
That won't take care of the capitalization. I.e. the result will be pretty much the same, because applying small caps to an upper case string will still display the string as all caps.

@dwlamb: You could try the following:

search: <li>([[:upper:]| ]+)</li>
replace: <li>\L\1</li>

This will change all upper case list items to lower case, and if you're using a Webkit based ebook app (Kindle, iBooks etc.), you could fix the capitalization issue by applying a text-transform style to the <li> element and/or add text-transform: capitalize; to your small-caps style.

Code:
li {text-transform: capitalize; font-variant: small-caps;}
If that's not an option, you'll probably have to come up with custom search & replace strings for two or more upper case words, or use a scripting language.
Doitsu 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
Sigil 0.4.1 : unwanted span added by Sigil Bertrand Sigil 0 09-02-2011 06:28 AM
Sigil 0.3.4 / Sigil 0.4.0 RC1 / Cover in Nook Color Bertrand Sigil 13 08-06-2011 05:06 AM
Sigil 0.3.4 / Problème CSS entre Sigil et iPad Grivels Software 10 07-03-2011 10:06 AM
Proper Use of Kobo?? strawfordt Kobo Reader 7 06-04-2010 12:40 AM
A proper introduction Seabound Introduce Yourself 6 09-26-2008 03:24 AM


All times are GMT -4. The time now is 03:46 AM.


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