The list iterator is one of the best features in FB, but what would make it even better would be having a double list iterator - two parallel lists, with each value going into a different variable. So you could do stuff like this:productreadme.txt | Readme.Txtfile29875.exe | Product.exe…Then have a rename operation renames from the first variable to the second. There are ways of achieving this atm (like, putting a delimiter in the middle of the list items), but they’re a bit fragile and inelegant.Alternatively, a lookup object where you could define key/value pairs would be great - combined with a normal list iterator you would get the same functionality. Again, there are ways of achieving this, with .ini files for instance, but an actual object (like a fileset) would be great…Steve
yeah, interesting idea, thanks Steve.
(one iterator I use often is the ADO Dataset iterator - it lets you set multiple variables for each iteration based on the values in a row in the database).
Steve,
If I understand correctly, then what you are essentially talking about is processing CSV text. I’m made requests for this option and it is supposedly on their To Do list.
For example, after a build, I have a tool that runs a checksum on all the files in a specific directory. So I created a CSV file to specify which directories to run in, and the name of a file to save the results to:
File1,Dir1
File2,Dir2
File3,Dir3
ect
I wanted to use a List Iterator to go through the list, run the tool on Dir1, save the results to File1, then go to the next line.
FinalBuider does not have a convienant way to do this, so you can see the work around I devised in this thread:
https://www.finalbuilder.com/forums.aspx?forumid=7&postid=1451&view=topic
It basically goes like this:
Iterate CheckSum.csv, each line to Variable CSVLine
DOS Command, use the FOR command to break the line down to an INI file
Read Variables From INI
Using tool, using variables just read
Iterate next line…
And again that DOS command would look like this:
FOR /f “delims=,tokens=1-3” %%A in ("%CSVLine%") do ECHO[FBVariables]>%TempINI%&ECHO Col1=%%A>>%TempINI%&ECHOCol2=%%B>>%TempINI%&ECHO Col3=%%B>>%TempINI%
and would output an INI file like this:
[FBVariables]
Col1=
Col2=
Col3=
Eep, are you sure you need DOS commands? If you must take the format you described as input, then I would as a first stage rewrite it as an .ini file with Text/Replace.
[Section]
c:\out\out1.txt=d:\dir1
c:\out\out2.txt=d:\dir2
…
Then use the .ini file iterator to parse that stuff really easily. I did something like this myself.
I’d be extremely surprised if there was something you needed FOR’s token parsing for that you couldn’t do with regular expression Text Find/Replace.
Steve