STGuru User's Guide

4. Editing Text/Text Files  Contents  6 Reading/Editing Text File(s) in Windows Explorer


5. Find and Replace


5.1 Find and Replace
5.2 Using Special Characters in Find and Replace

5.3 Batch Replace

 


5.1 Find and Replace
The find and replace function of STGuru is powerful. There is a 2-in-1 find/replace dialog box for the upper and lower edit area independently. When you check on the "Enable Replace" checkbox, it will be a Find and Replace dialog box where you can replace what you hope to replace. If you check off this check box, you can find text in a safe way, and prevent the possible accident in replacing some text out of your will.

 

Pic UG-5-1 The Find/Replace function is very powerful

 

5.2 Use Special Characters
When you checked on the "Use Special Characters" check box, your can use special characters in your find or replace string.
There are 4 kinds of special characters:

 

1) ^characters:

Syntax

Hex Value

Meaning

^p

0x0D + 0x0A

Windows carriage return. Same as "\r\n" below.

^n

0x0A

Unix carriage return. Same as "\n" below.

^t 0x09 Tab character. Same as "\t" below.
^h N/A Means Home - mark for the start of the current file. It is meaningful only in the find string. It should not appear in the replace string, and has no special meaning even it appears there.

^e

N/A

Means End - mark for the start of the current file. It is meaningful only in the find string. It should not appear in the replace string, and has no special meaning even it appears there.

 

2) \ characters:

Syntax

Hex Value

Meaning

\r

0x0D + 0x0A

Carriage return

\n

0x0A

Unix carriage return (New line)

\t

0x09

Tab character.

 

3) Hexadecimal characters:

Syntax

Hex Value

Meaning and Examples

\0xX1X2

0xX1X2

X1 and X2 here are 0-9 or A-F, and X1X2 should range between 01and FF. that's 1-255 in ASCII table. If the value is less than 0x10 (16), the first one place should be filled with 0, rather than left there in blank.

Ex1: \0x0D\0x0A (Windows carriage return)

Ex1: \0x20 (blank space)

 

4) Decimal characters:

Syntax

Decimal Value

Example and Meaning

\0dN1N2N3

N1*100+N2*10+N3

N1, N2 and N3 are digital numbers between 0-9. The minimum value should be 001, the maximum value should be 255. If the value is less than 100, the first one or two place(s) should be filled with 0, rather than left there in blank.

Ex1: \0d013\0d010 (Windows carriage return)

Ex1: \0d032 (blank space)

 

5.3 Batch Replace
 

When you check on the Enable Replace check box at bottom left of the Find/Replace dialog box, the professional level edit function "Batch Replace" is enabled.

 

Click the "Batch Replace" button to open the "Batch Replace" dialog box:

 

 

Pic UG-5-2 The main Batch Replace dialog box

 

You can, in one click, perform a series of replace operation for unlimited number of find/replace pairs in predefined order. You can set four independent options for each pair - Apply, Match Whole Word, Match Case, and Use Special Characters. You can save each batch replace configuration to a batch file for long term use.

 

This is not only a great tool for text editing, but also of great additional help for code conversion between Simplified Chinese and Traditional Chinese.

 

Three page cleaning macros are included in the installation pack. They can be used to normalize and reorganize punctuations, blank spaces and paragraph-level page layout, and can be used as samples against which to edit and create batch replace macros.