The syntax for a Conversion File is:

 

Only lines beginning / or " are used. Others are ignored completely.

Every string for conversion is of the form "A" -> "B". That is, the original string, the one you're searching for, enclosed in double quotes, is followed by a space, a hyphen, the > symbol, and the replacement string.

You can use " (double quotes) and hyphen where you like without any need to substitute them, but for obvious reasons there must not be a sequence like " -> " in your search or replace string.

 

Removing all tags

To remove all tags, choose "<*>" -> "" as your search string.

 

Control Codes

Control codes can be symbolised like this: {CHR(xxx)} where xxx is the number of the code. Examples: {CHR(13)} is a carriage-return, {CHR(10)} is a line-feed, {CHR(9)} is a tab. To represent <Enter> which comes at the end of paragraphs and sometimes at the end of each line, you'd type {CHR(13)}{CHR(10)} which is carriage-return followed immediately by line-feed.

Use {CHR(34)} if you need to refer to double inverted commas. See search-word syntax for more.

 

Wildcards

The search uses the same mechanism that Concord uses. You may use the same wildcards as in Concord search-word syntax. By default the search-and-replace operates on whole words.

Examples:

"book" -> "bk" will replace book with bk but won't replace books or textbook

"*book" -> "bk" will replace book or textbook with bk but won't replace books or textbooks

"book*" -> "bk" will replace book or books with bk but won't replace textbook or textbooks

To show a character is to be taken literally, put it in quotes (e.g. "*","<").  See below for use of the /L parameter.

 

Unbounded, case Insensitive, Confirm, redundant Spaces, redundant <Enter>s

/C stops to confirm you wish to go ahead before each change.

/U does an unbounded search (ensuring the alteration happens whether there's a word separator on either side or not) (/U "the" finds the but also finds other, then and bathe).

/I does a case insensitive search (/I "restaurant" -> "hotel" replaces restaurant with hotel and RESTAURANT with HOTEL and Restaurant with Hotel, i.e. respecting case as far as possible).

/S cuts out all redundant spaces. That is, it will reduce any sequence of two or more spaces to one, and it also removes some common formatting problems such as a lone space after a carriage-return or before punctuation marks such as .,; and ). /S can be used on a line of its own or in combination with other searches.

/E cuts out all redundant <Enter>s. That is, it will reduce any sequence of two or more carriage-return+line-feeds (what you get when you press Enter or Return) to one. /E can be used on a line of its own or in combination with other searches.

/L means both the search and replace strings are to be taken as literal. (Normally a sequence like <#*> would need quotes around each character because < > are mark-up signals and # and * are special wildcard characters, thus "<""#""*"">" which is tricky! Put /L at the start of the line to avoid this.)

 

You can combine these, e.g.

/IC "the" -> "this"

 

See Documents\wsmith7 \convert.txt to see examples in use.

 

See also: Text Converter Contents.

Click the Permalink button if you want to copy a link to this page.