Special characters

The special codes in the Find What and Replace With boxes depends on which type of match is being used.

Searching in Cells

Microsoft Excel provides the following special 'wildcard' characters.

UseTo find
? (question mark)Any single character
For example, sm?th finds "smith" and "smyth"
* (asterisk)Any number of characters
For example, *east finds "Northeast" and "Southeast"
~ (tilde) followed by ?, *, or ~A question mark, asterisk, or tilde
For example, fy91~? finds "fy91?"

Microsoft Excel uses the tilde (~) as a marker to indicate that the next character is a literal. When you click Find or Replace on the Edit menu to replace or search for a tilde (~), an asterisk (*), or a question mark (?), you must precede the character with a tilde (~).

NOTE: If you want to find or replace a tilde in your worksheet, you must type a double tilde (~~).

Example 1: How to Find and Replace Numbers

To replace wildcard characters (*) in a numeric value in a worksheet cell, use the steps in the following example:
1.Type 494** in cell A1, then save and close the document.
2.Select cell A1.
3.In ExcelPipe's Find what box, type ~* (press TILDE, and then press ASTERISK).
4.In the Replace with box, type 2.
5.Click Replace.
Cell A1 will now read 49422.

NOTE:
When you type an asterisk without a tilde in the Find what box, ExcelPipe replaces all entries with a 2. Excel treats the asterisk as a wildcard character. Therefore, 494** becomes 2.

Example 2: How to Find and Replace a Tilde

To replace a tilde in an Excel worksheet cell, use the steps in the following example:
1.Type Micros~1.xls in cell A1.
2.Select cell A1, then save and close the document.
3.In ExcelPipe's Find what box, type:
~~
4.In the Replace with box, type:
oft
5.Click Replace All.
Cell A1 now reads Microsoft1.xls.

Searching in Links and other 'Hidden' Locations

You can specify one or more of the macros below to insert custom text in the Replace With field.

Macro Name

Description

@inputFilename@ or @filename@

Replaced by the name of the current file being processed. The drive and path section of the filename is removed.

@fullInputFilename@

Same as @inputFilename, except it includes the complete path

@inputPath@

The path to the input file, with a trailing slash e.g. 'c:\my files\'

@inputExtension@

The extension of the input file e.g. '.txt'

@clipboard@

Inserts the contents of the Windows clipboard

@time@

Inserts the time in the format HHMMSS

@date@

Inserts the date in the format YYYYMMDD

@datetime@

Inserts the date and time in the format YYYYMMDDHHMMSS

@_year@

Inserts the year in the format YYYY

@_month@

Inserts the month in the format MM

@_day@

Inserts the day in the format DD

@_hour@

Inserts the hour in the format HH

@_minute@

Inserts the minute in the format MM

@_second@

Inserts the second in the format SS

@randomdigit@

Inserts a random digit from 0-9. For two digits, use @randomdigit@@randomdigit

@randomletter@

Inserts a randomletter from A-Z. For two letters, use @randomletter@@randomletter

@ENV_varname@

Where varname is the name of an environment variable, this inserts the value of a environment variable e.g. @ENV_OS inserts the text 'Windows_NT' on an NT system. See below for 'what are environment variables'

Special requirements

Replace With text:

With Macro Values

Results in:

If you need to put an @ in the text, simply double it i.e. @@.

hello@@

N/A

hello@

If you need to include the literal name of a macro, just double the @

@@randomdigit

@randomdigit=7

@randomdigit

If you need to place letters or digits immediately after a macro name, end the macro name with @.

@randomdigit@@randomdigit

@randomdigit=7, @randomdigit=2

72

&

@randomdigit@@@

@randomdigit=7

7@