MS Word: Find-Replace Format with Wildcards?

Status
Not open for further replies.

MumblingSage

Inarticulate Herb
Super Member
Registered
Joined
May 15, 2008
Messages
2,308
Reaction score
349
Location
in a certain state of mind
Hello, computer wizzes of AW.

I'm converting a manuscript into an ebook, and I'm about to do what Smashwords Calls the "Nuclear Option": copy & past the whole thing into Notepad to scrub formatting before redoing it all. I'm prepared for that, but beforehand I want to markup all my italics, bold, etc in a way that carries over to .txt format.

I'm thinking the standard *bold* and _italics_. MS Word autocorrect has an option to convert *bold* and _italics_ to real formatting, so that won't be a problem. But I'm currently overwhelmed at the thought of converting 200 pages in the opposite direction. Is there a way I can use find-replace to turn italicized text into _italicized text_?
 

onesecondglance

pretending to be awake
Kind Benefactor
Super Member
Registered
Joined
May 2, 2012
Messages
5,359
Reaction score
1,664
Location
Berkshire, UK
Website
soundcloud.com
Yes - and it's actually easier than I thought.

- Open Find & Replace (Ctrl-H).
- Click the "More" button to show all the options (e.g. match case, etc.)
- Don't type anything in the Find field, and instead click the "Format" button at the bottom of the F&R dialogue box.
- Select "Font" from the menu, and select Italic in the formatting pop-up.
- Click in the Replace field.
- Click "Format" and select Regular in the formatting pop-up.
- Click the "Special" button - it's next to the "Format" button.
- Select "find what text" from the menu - this will put the characters ^& into the Replace box*.
- Type an underscore character either side of the ^&.

So what you end up with is something like this:

Find
Format: Font: Italic


Replace _^&_
Format: Font: Not Bold, Not Italic

- Hit Replace - I'd go one item at a time rather than going straight into Replace All. Make sure it's working correctly first!


Now, it's not perfect. For instance, if you have a trailing space that's also formatted as italic, then your underscore will appear after that. So you could end up with this sort of thing:

In: This is an example of what could go wrong
Out: _This is an example _of what could go wrong

Instead of this:

Out: _This is an example_ of what could go wrong

So make sure you've formatted things accurately in the first place! :)




* - I have no idea if you could just type in the ^& or if it only works when selected from the menu - Word can be like that sometimes.
 
Last edited:

Alexys

Took a wrong turn at the Pleiades
Super Member
Registered
Joined
Jun 5, 2011
Messages
341
Reaction score
30
Location
On the wrong planet. ;P
You should be able to type the ^& (I've probably done it a hundred times with ^p, in very old versions of Word).
 

MumblingSage

Inarticulate Herb
Super Member
Registered
Joined
May 15, 2008
Messages
2,308
Reaction score
349
Location
in a certain state of mind
Yes - and it's actually easier than I thought.

- Open Find & Replace (Ctrl-H).
- Click the "More" button to show all the options (e.g. match case, etc.)
- Don't type anything in the Find field, and instead click the "Format" button at the bottom of the F&R dialogue box.
- Select "Font" from the menu, and select Italic in the formatting pop-up.
- Click in the Replace field.
- Click "Format" and select Regular in the formatting pop-up.
- Click the "Special" button - it's next to the "Format" button.
- Select "find what text" from the menu - this will put the characters ^& into the Replace box*.
- Type an underscore character either side of the ^&.

So what you end up with is something like this:

Quote:
Find
Format: Font: Italic


Replace _^&_
Format: Font: Not Bold, Not Italic
- Hit Replace - I'd go one item at a time rather than going straight into Replace All. Make sure it's working correctly first!

Now, it's not perfect. For instance, if you have a trailing space that's also formatted as italic, then your underscore will appear after that. So you could end up with this sort of thing:

In: This is an example of what could go wrong
Out: _This is an example _of what could go wrong

Instead of this:

Out: _This is an example_ of what could go wrong

So make sure you've formatted things accurately in the first place!

* - I have no idea if you could just type in the ^& or if it only works when selected from the menu - Word can be like that sometimes.

I'm afraid I don't have a "Find what text" option in my version of Word (2010). But I'll see what other characters are available!

You should be able to type the ^& (I've probably done it a hundred times with ^p, in very old versions of Word).

I've been told "^&" is not a valid character for the output box.

*sigh* Looks like I might have a day and night of hand-formatting ahead of me. Thanks for the insights, though, guys! They'll be helpful in the future, I'm sure.
 

LJD

Super Member
Registered
Joined
Sep 12, 2010
Messages
4,226
Reaction score
525
I'm afraid I don't have a "Find what text" option in my version of Word (2010). But I'll see what other characters are available!

No? I have Word 2010, and I have it. Only in the "replace" box though; it doesn't work under "find what." (Because it's referring to the text in the "find what" box.)

To find _italic_ text, use: _<*>_
 

bonitakale

Super Member
Registered
Joined
Aug 22, 2008
Messages
1,485
Reaction score
165
Location
Cleveland, Ohio, USA
Website
www.bkedits.com
I just checked (I have Word 2010, also), and "Find What Text" is the tenth item down in the menu. BUT that menu only comes up after you've clicked on the "replace" field. If you hit "special" before clicking on "replace," then "Find What Text" isn't on the menu.

Of all the stupid ways to design it...
 

onesecondglance

pretending to be awake
Kind Benefactor
Super Member
Registered
Joined
May 2, 2012
Messages
5,359
Reaction score
1,664
Location
Berkshire, UK
Website
soundcloud.com
I just checked (I have Word 2010, also), and "Find What Text" is the tenth item down in the menu. BUT that menu only comes up after you've clicked on the "replace" field. If you hit "special" before clicking on "replace," then "Find What Text" isn't on the menu.

Of all the stupid ways to design it...

Well, it needs to know what you're referring to, doesn't it? If your cursor is still in the "Find" field, then of course you can't search for the "Find what" text. That's a recursive loop.
 

MumblingSage

Inarticulate Herb
Super Member
Registered
Joined
May 15, 2008
Messages
2,308
Reaction score
349
Location
in a certain state of mind
Oh, hey, thanks for finding that, Bonitakale! And thanks for sticking with me onesecondglance!

I guess I just have to perform the ritual in the right order for the spirits of MS Office to obey me, then...

Update: It works! Witchcraft, I tell you. We'll all be burned at the stake!
 
Last edited:
Status
Not open for further replies.