Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Sony Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 08-22-2007, 11:37 PM   #1
edbro
Banned
edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.
 
Posts: 640
Karma: 4911
Join Date: Jul 2007
Location: Grapevine, TX
Device: iPad4
Macro help - Itals from txt

Can anybody think of a way in Word to convert the conventional "_ital_" in text files to be "ital"? I get lots of text files that use the underscore to annotate stop and start italics.
edbro is offline   Reply With Quote
Old 08-23-2007, 02:37 AM   #2
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
I just do it manually. I've never come across a book where that takes more than a few minutes.
HarryT is offline   Reply With Quote
Advert
Old 08-23-2007, 03:05 AM   #3
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: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
txt2lrf does this automatically.
kovidgoyal is offline   Reply With Quote
Old 08-23-2007, 03:34 AM   #4
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
I actually prefer to do it manually, because PG texts are far from perfect - they very often leave out the closing underscore, or have it in the wrong place. Just another example of our differing approach, Kovid - you're creating tools for automatic conversion; I prefer the more "personal" approach . Both have their place.
HarryT is offline   Reply With Quote
Old 08-23-2007, 03:54 AM   #5
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: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Ah but see you could edit the txt file to your heart's content and then leave the _words_ for txt2lrf to take care of. Thereby reducing the amount of manual labor you need to put in. The *2lrf tools don't force you to do automatic conversion. I don't know if your familiar with TeX, but their philosophy is based on it. Think of them as the last stage of a toolchain, like a compiler. You prepare the sources (TXT or HTML files) and then compile them into machine readable output (LRF file).

Indeed txt2lrf was designed with the goal of allowing perfectionists like you to edit the TXT file to your hearts content and end up with a TXT file that looks good by itself and that can be automatically converted into a pretty LRF with images and a TOC and what have you.
kovidgoyal is offline   Reply With Quote
Advert
Old 08-23-2007, 08:36 AM   #6
ricdiogo
Gutenberger
ricdiogo will become famous soon enoughricdiogo will become famous soon enoughricdiogo will become famous soon enoughricdiogo will become famous soon enoughricdiogo will become famous soon enoughricdiogo will become famous soon enoughricdiogo will become famous soon enough
 
ricdiogo's Avatar
 
Posts: 142
Karma: 700
Join Date: Jul 2007
Location: Lisbon, Portugal
Device: Cybook Gen 3
Quote:
Originally Posted by edbro View Post
Can anybody think of a way in Word to convert the conventional "_ital_" in text files to be "ital"? I get lots of text files that use the underscore to annotate stop and start italics.
Use _(*)_ (wildchars enabled) in the "Find" field. Then place your cursor in the "Replace" field and hit the More/Format/Font and select "Italic". Don't type anything in that field. Then "Replace all".
Then, write _ in the "Find" field (wildchars disabled). Be sure you remove the formatting instructions from the "Replace" field and that you haven't hit space bar in the field. "Replace all".

(Edit: )
If something looks wrong after you did this properly, probably the problem is that one of the _italics was not closed in the *.txt. The number of underscores in the *.txt must be a pair. Please report it to PG using errata (at) pglaf (dot) org email address.

Last edited by ricdiogo; 08-23-2007 at 09:23 AM.
ricdiogo is offline   Reply With Quote
Old 08-23-2007, 08:38 AM   #7
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Brilliant! Thanks, Ricardo - I've never managed to get wildcard searches to work in Word.
HarryT is offline   Reply With Quote
Old 08-23-2007, 08:45 AM   #8
edbro
Banned
edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.
 
Posts: 640
Karma: 4911
Join Date: Jul 2007
Location: Grapevine, TX
Device: iPad4
When I tried it Word actually replaced everything with "(*)". Yes, I did check "use wildcards". What did I do wrong?
edbro is offline   Reply With Quote
Old 08-23-2007, 08:49 AM   #9
ricdiogo
Gutenberger
ricdiogo will become famous soon enoughricdiogo will become famous soon enoughricdiogo will become famous soon enoughricdiogo will become famous soon enoughricdiogo will become famous soon enoughricdiogo will become famous soon enoughricdiogo will become famous soon enough
 
ricdiogo's Avatar
 
Posts: 142
Karma: 700
Join Date: Jul 2007
Location: Lisbon, Portugal
Device: Cybook Gen 3
You probably didn't use the underscore. It as to be: _(*)_
If you just use (*) you'll get the whole text in italics.
ricdiogo is offline   Reply With Quote
Old 08-23-2007, 09:17 AM   #10
edbro
Banned
edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.
 
Posts: 640
Karma: 4911
Join Date: Jul 2007
Location: Grapevine, TX
Device: iPad4
I did use the underscore. When I said it replaced everything, I meant it replaced all occurrences of _italics_ with _(*)_.
edbro is offline   Reply With Quote
Old 08-23-2007, 09:19 AM   #11
edbro
Banned
edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.edbro is fluent in JavaScript as well as Klingon.
 
Posts: 640
Karma: 4911
Join Date: Jul 2007
Location: Grapevine, TX
Device: iPad4
Ahh, I got it now. I was putting the _(*)_ in the replace field also. Thank you very much for your help.
edbro is offline   Reply With Quote
Old 08-23-2007, 09:25 AM   #12
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,966
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I'm trying _(*)_ in Word 2003 and it just isn't working. what am I doing wrong?

Never mind.. got it working.
JSWolf is offline   Reply With Quote
Old 08-23-2007, 09:27 AM   #13
ricdiogo
Gutenberger
ricdiogo will become famous soon enoughricdiogo will become famous soon enoughricdiogo will become famous soon enoughricdiogo will become famous soon enoughricdiogo will become famous soon enoughricdiogo will become famous soon enoughricdiogo will become famous soon enough
 
ricdiogo's Avatar
 
Posts: 142
Karma: 700
Join Date: Jul 2007
Location: Lisbon, Portugal
Device: Cybook Gen 3
No prob edbro
JSWolf describe your steps please.
ricdiogo is offline   Reply With Quote
Old 08-23-2007, 09:29 AM   #14
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: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
http://office.microsoft.com/en-us/he...873051033.aspx
kovidgoyal is offline   Reply With Quote
Old 11-16-2007, 07:47 PM   #15
Stephanos
Connoisseur
Stephanos doesn't litterStephanos doesn't litter
 
Posts: 62
Karma: 133
Join Date: Oct 2007
Location: Minnesota, USA
Device: Kobo Aura Edition 2
For some reason, if you use the macro recorder while doing the search and replace described above, the resulting macro doesn't work. Through trial and error I found that you need to insert a line of code into the macro, so that it reads:

Code:
Sub UnderscoreToItal()
'
'
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "_(*)_"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .Replacement.Font.Italic = wdToggle
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "_"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
End Sub
Stephanos is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Word Formatting Macro (Stingo's Macro) Stingo Sony Reader 75 08-24-2010 05:18 AM
Kindle DX Graphite first look and macro shots of text MobileTechReview Amazon Kindle 31 07-09-2010 05:37 PM
Macro photos of Vizplex E Ink Magnesus General Discussions 4 04-23-2010 03:04 PM
Spelling Macro PieOPah Workshop 36 12-13-2008 02:27 AM
Emdash - punctuation macro ProDigit Sony Reader 8 11-28-2008 02:32 AM


All times are GMT -4. The time now is 11:37 AM.


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