OutWit's simple string sequence generation format.
This function allows you to generate a series of strings using a simple "matrix" string 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 matrix 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: For now, as the feature is mostly used to generate URLs, all space characters are replaced by %20. We will add more intelligence to the code in a later version to automatically decide whether the replacement should be done or not.
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 in 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
Use [#ASK#] if you wish to be prompted for a value at the time of resolution of the matrix. (Do not use this option if the matrix 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.)
If you wish to use one of the reserved characters in a matrix, excape 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.