search for text in italics

Have a problem? A question? This is the place for answers from other Express users.
Post Reply
disfasia
Posts: 64
Joined: 2004-11-30 16:23:08

search for text in italics

Post by disfasia » 2009-03-02 12:52:03

I have been told by my editor to replace all italicized text with underlined text in a long manuscript. How can I do this using search/replace?

Thanks

Groucho
Posts: 496
Joined: 2007-03-03 09:55:06
Location: Europe

Re: search for text in italics

Post by Groucho » 2009-03-03 01:45:18

Open the Search and Replace window (comand-F).
Select PowerFind Pro from the "Using:" pop-up.
In Find what digit: .+
In Replace with digit: \0
Select all the content in the Find What pane and apply italics, or hit command-I.
Select all the content in the Replace with pane and apply underlined, or hit command-U.
Click Replace All.

Any trouble let me know.

Cheers, Henry.

disfasia
Posts: 64
Joined: 2004-11-30 16:23:08

Re: search for text in italics

Post by disfasia » 2009-03-03 05:22:34

Thanks...but I did this and nothing happens. It says not text found.

What to do?

Thanks again.

Kino
Posts: 400
Joined: 2008-05-17 04:02:32

Re: search for text in italics

Post by Kino » 2009-03-03 06:03:27

Unfortunately the attribute sensitive find/replace is not available in Nisus Writer Express. So try the attached macro:
Itlic2Underline.pl.zip
(744 Bytes) Downloaded 342 times

Code: Select all

#!/usr/bin/perl
#Nisus Macro Block
#source front
#send text as RTF
#destination new
#End Nisus Macro Block

while (<STDIN>) {
	s/(\\AppleTypeServices [^}]*)\\i/$1\\ul/g;
	print;
}

### end of script ###
This macro modifies rtf code directly and produces a new document with italic style attribute replaced by underline style attribute. It does not touch the original document.

I have not tested the macro extensively. It may not work properly for mixed attributes. As for Italic applied via character/paragraph styles, it would be better to change the definition of those styles.

Groucho
Posts: 496
Joined: 2007-03-03 09:55:06
Location: Europe

Re: search for text in italics

Post by Groucho » 2009-03-03 08:23:50

My fault, sorry. I should have remembered that NWE doesn't support search with attributes.

Below is another (and faster) way.

Select any occurrence of italicized text.
A small "a" should appear on the statusbar (at the window's bottom).
Click on the "a" and select "Select All". This will select all occurrences of italicized text in the document.
Hit command-I, or select Format > Italics, or click Italics in the Character palette, to toggle the attribute back to regular.
Apply an underline format by hitting command-U, selecting Format > Underline > Single, or clicking Underline in the Character palette.

Cheers, Henry.

disfasia
Posts: 64
Joined: 2004-11-30 16:23:08

Re: search for text in italics

Post by disfasia » 2009-03-03 19:19:50

Wow! Thanks for all the suggestions. Your suggestion worked like a charm Henry... Thanks again to all!

Cheers.

Post Reply