Macro Commands

Top  Previous  Next

"Macro" is a type of value that generates random data according to an user-defined macro. It's a powerful way of generating custom string data.

 

Also see the Macro Editor.

 

When creating a macro, the following are legal macro command characters:

 

A[:n;]

Random upper case alphabetical character, optionally repeat n times, include closing character ';' when n is used.

a[:n;]

Random lower case alphabetical character, optionally repeat n times, include closing character ';' when n is used.

C[:n;] or c[:n;]

Random mixed case alphabetical character, optionally repeat n times, include closing character ';' when n is used.

N[:n;] or n[:n;]

Random numerical digit, optionally repeat n times, include closing character ';' when n is used.

R[:n;] or r[:n;]

Random character, including digits, punctuation etc. Optionally repeat n times, include closing character ';' when n is used.

H[:n;] or h[:n;]

Random hexadecimal digit (0..9, A-F), optionally repeat n times, include closing character ';' when n is used.

@

Random domain name and top level domain name concatenated to this format: randomname.randomtld

eg: hotmail.com

[...]

Literal text, the text between brackets is taken as a constant

{n[:r]}

Random entry taken from a "data library", n is the number of a data library

Optionally remove special characters if you add "r".

{F[r,s,u]:<filespec>}

Random, sequential or unique value from the given file. Defaults to "random". Make sure to include the closing character "}".

{C:<column number>[:r]}

Take a generated value from column column number and use it. The first column in the table is 1, these numbers are visible in the tree view with tables and columns. Make sure to include the closing character "}".

Optionally remove special characters if you add "r".

#S[:n[:m][:t];]

Sequential value, optionally use n digits, starts at m and use t to trim leading zeroes. All values are integers, the closing character ';' is required when there's formatting or other options, it can be left out without.

#R[:n[:m][:o][:t];]

Random value, optionally uses n digits, bottoms at m, tops at o and use t to trim leading zeroes. All values are integers, the closing character ';' is required when there's formatting or other options, it can be left out without.

(...)

Creates a group, useful to create multiple macros in combination with the branch command. See examples below.

../..

Creates a branch, useful in combination with the group command. See examples below.

 

Examples:

 

Dutch Zip-code:

NNNN[ ]AA                

 

Possible results:

4214 PO

7645 AB

 

 

Random e-mail address:

{3000}[.]{4000}[@]@

 

 

Last name, First name:

{4000}[, ]{3000}

 

Possible results:

Gerda, Iglehart

Justin, Kleinke

 

 

Unique value from file "c:\temp\testvalues.txt":

{Fu:c:\temp\testvalues.txt}

 

 

Random values, from 1000 to 9999:

#R:4:1000;

 

or

 

#R:4:1000:9999;

 

Grouping and branching examples

With grouping an branching you can create macros with different parts and make them even more flexible. Below are a couple of examples to explain this further. A 'group' command requires a branch, which is added automatically when using the editor.

 

A/a/R

This will either take

A
a
R

as the value for the given macro position.

Aa/aa/R@

This will either take

Aa
aa
R@

as the value for the given macro. Basically, this takes a selection of 3 possible macros.

(A/a/R)[text]@

Will generate

A[text]@
a[text]
R[text]@

as the value. Because (A/a/R) is group, this represents a grouped value, but there's branches in the group so it will take one of the branches, then following by the rest of the macro sequence of [text]@.

 

A/a/R[text]@

Will generate

A
a
R[text]@

as the value. Different from the previous example: the branches aren't in a group, so that means there's 3 macros instead of branches with an additional piece.

(Aa[text]/aR/R)[text]@

Will generate

Aa[text][text]@
aR[text]@
R[text]@

as the value. There's branches in the group, the group is followed by the rest of the macro.