Find Replace query

For all things Mellel

Moderators: Eyal Redler, redlers, Ori Redler

Post Reply
Declan
Knows everything, can prove it
Posts: 79
Joined: Sun Nov 02, 2008 11:28 am

Find Replace query

Post by Declan »

I have never really deciphered the instructions on Find/Replace. What I am doing now is writing on an Alphasmart and sending the information to various applications. Since the Alphasmart does not support italics etc., I would like to use a simple markup and then use Find/Replace.

The simple case is, as mentioned, italics.
If the imported text is "on the *other* side", how do I instruct mellel to take all text inside a pair of asterisks, and replace the contained text with Main Body Text, Variation 2?

The complicated case is:
How to I make "#The Beginning#" adopt the features of Autotitle 1, or "##Before the Rains##" adopt the features of Autotitle 2?

Any assistance would be most appreciated.
Thanks,

Declan
kjmatthews
Knows everything, can prove it
Posts: 113
Joined: Wed Jan 17, 2007 2:17 am

Re: Find Replace query

Post by kjmatthews »

I do something similar with highlights I export from Skim. First, highlight all the text and change it to Main Body Text, or whatever you want it to be. You can't change paragraph styles with Find/Replace.

Then, try this query (ignore the text that appears to be hidden by the image — my screen capture accuracy leaves something to be desired):
Image

Highlight the item in the "replace" field and type the shortcut for variation 2.

If you can't decipher the documentation, I recommend that you spend some time experimenting with Find/Replace. It's extremely powerful. You'll have to do a little experimenting anyway to get the query I've posted here. Remember that you can double-click on brackets to change their characteristics. In this example, you'll want to set the option in the dropdown list to "Once," and make sure "Greedy" and "Capturing" are checked.
suavito
Knows everything, can prove it
Posts: 135
Joined: Sun Mar 25, 2007 11:16 pm
Location: Germany

Re: Find Replace query

Post by suavito »

AlphaSmart Dana here!

Since I send to various applications too I never used the Search & Replace functions of each of these applications but a universal solution: TextSoap: http://www.unmarked.com/textsoap/index.html

I found it pricey but indispensable. One replace routine to fix them all! And one keyboard shortcut for all and a context menue entry (the trial version is limited in this aspect, if I remember correctly).

Highly recommended for heavy users.
The finger is the most popular bird.
Declan
Knows everything, can prove it
Posts: 79
Joined: Sun Nov 02, 2008 11:28 am

Re: Find Replace query

Post by Declan »

Thanks for the suggestions.
Could kjmatthews, or anyone else, tell me what options on the "insert element" dropdown bring about that fine collection of hieroglyphics. It looks very impressive!

Declan
kjmatthews
Knows everything, can prove it
Posts: 113
Joined: Wed Jan 17, 2007 2:17 am

Re: Find Replace query

Post by kjmatthews »

Declan wrote:Could kjmatthews, or anyone else, tell me what options on the "insert element" dropdown bring about that fine collection of hieroglyphics.
The asterisks on either end are typed. The rest you can figure out by experimenting. It should only take a minute or two.
Declan
Knows everything, can prove it
Posts: 79
Joined: Sun Nov 02, 2008 11:28 am

Re: Find Replace query

Post by Declan »

I did. No luck. I'll try again.

Declan
rpcameron
Knows everything, can prove it
Posts: 980
Joined: Wed Oct 26, 2005 12:48 am
Location: IE, CA, USA

Re: Find Replace query

Post by rpcameron »

Declan wrote:Thanks for the suggestions.
Could kjmatthews, or anyone else, tell me what options on the "insert element" dropdown bring about that fine collection of hieroglyphics. It looks very impressive!
The first thing inserted is "Any character" (the asterisk in the box). Then, double-click on it, and change the setting to "Repetition: Once or more" (the "1+" superscript). Then, highlight that item, and click the group button (the brackets under the text field). This creates a reference group (the brackets with the embedded "1", denoting that it's the first reference group). Then, surround that reference group with whatever marking you are looking for (surrounded by asterisks, hashes, &c.).

In the replace box, select "Backreference". This will give you the box with "<1" in it. That will match whatever is in the reference group in the find box. Then, apply styling to the the backreference for your new formatting.

This is basically the same as \*(.?+)\* in the search box, and \1 in the replace box if you're familiar with regular expressions.
— Robert Cameron
Declan
Knows everything, can prove it
Posts: 79
Joined: Sun Nov 02, 2008 11:28 am

Re: Find Replace query

Post by Declan »

Thanks. I had managed to figure it out. The part I was missing was the double click on the any character box. Once I managed that, I took courage, and continued clicking things until I got it right. A very powerful set of tools, apparently. I hope to understand it some day.

Declan
Post Reply