OutWit's simple string sequence generation format.
This function allows you to generate a series of character strings using a simple pattern (or generation matrix) where variable or incremented parts are expressed between brackets.
The most frequent use of this function is the generation of URLs that will be used to execute queries from online sources (hence the name).
This feature is used in several parts of the program:
You can, for instance, want to visit the following pages:
With OutWit, you will be able to define the queries as a single pattern string:
http://www.myMusicDB.org/search?[Wolfgang Amadeus Mozart;Franz Liszt;Johannes Brahms;Frederic Chopin]
or, for a series of pictures:
myFavoriteMovieStar[001:200].jpg,
which will generate the 200 names in the range.
NOTE: If you haven't used %20 in the pattern and if the Hub recognizes that the feature is being used to generate URLs (http/ftp/file...), space characters will be replaced by +.
Use [xx:yy] to define the range of numerical indexes to increment. (If you put leading zeros, OutWit will add leading zeros in the whole series.)
string[5:11] will generate the following sequence: string5, string6, string7, string8, string9, string10, string11
string[095:101]will generate the following sequence: string095, string096, string097, string098, string099, string100, string101
string[312:309] will generate the following sequence: string312, string311, string310, string309
Use [aa:bb] to define the range of alphabetical indexes to increment.
Use [one;two;three;four] to define a series of values.
"[jan;feb;mar;apr;may;june], [01:31]" will generate all combinations between "jan, 01" and "june, 31" (Yes, it will create 31 days for each month.)
Use [xx:yy/5] to define a step of 5 between the generated values.
Use [#n#a;b;c;d;e] to mark groups of series that must be incremented together item by item, without generating all possible combinations:
firstName=[#1#peter;mike;john;martin]&lastName=[#1#black;wilson;moore;woods] will only generate:
firstName=peter&lastName=black
firstName=mike&lastName=wilson
firstName=john&lastName=moore
firstName=martin&lastName=woods
fromYear=[#1#1960:2000/10]&toYear=[#1#1969:2009/10] will generate:
fromYear=1960&toYear=1969
fromYear=1970&toYear=1979
fromYear=1980&toYear=1989
fromYear=1990&toYear=1999
fromYear=2000&toYear=2009
If the series of a group have different sizes, the program will roll as many times as necessary through the values of the smallest to match the number of values of the longest.
[#1#Sylvie;Mary;Georgio;Gus;Rita;Paulo;Stef;Lily]->[#1#Blue_Room;Red_Room;Pink_Room] will generate:
Sylvie->Blue_Room
Mary->Red_Room
Georgio->Pink_Room
Gus->Blue_Room
Rita->Red_Room
Paulo->Pink_Room
Stef->Blue_Room
Lily->Red_Room
Use [#ASK#] if you wish to be prompted for a value at the time of resolution of the pattern. (Do not use this option if the pattern is to be used in a job that you wish to execute in your absence.) Note that you can use the OutWit Query Generation format in the string you type here.
Use [#YEAR#], [#MONTH#], [#DAY#], [#HOURS#], [#MINUTES#], [#SECONDS#], [#MILLISECONDS#], [#DATE#], [#TIME#], [#DATETIME#] to insert the respective values in your string.
Use #RANDOM[xx:yy]# if you wish to generate a random integer. This will only generate one integer. If you want a series of random numbers, you can use: [#RANDOM[xx:yy]#;#RANDOM[xx:yy]#;#RANDOM[xx:yy]#;...]. (Note that this feature only works with digits at the moment.)
Use [#SHUFFLE#xx:yy] or [#SHUFFLE#a;b;c;d;e]if you wish to shuffle the list of generated strings. This is useful, for instance if you generate URLs to explore and want to do it in a random order instead of sequentially, or if you want to shuffle the list of proxy IP addresses you entered in the proxy preference panel.
In general the simplest way to avoid syntax errors is to filter out the characters used in the pattern syntax (mostly colon, semicolon, left and right square brackets). If you have to use one of the reserved characters in a pattern, escape it as you would for a regular expression. This means that if you need to use one of the following characters ; : [ or ], you need to type a \ before it.