Copy a file list

Hello,

I have a variable that looks like this

"file1.dat,file2.dat,file3.dat"  (Filenames separated with comma)

or

"file1.dat;file.dat;file3.dat" (Filenames separated with semicolon)

I want to copy these files with XCopy from one folder to another.

So, how to create a loop on the filenames?

Is there a way to split a string to tokens?

Or is there a way to copy a file list?

Or is there a way to create a File Set from this string variable?

  1. Replace the commas with linefeeds (using text find/replace)
    2. Use a List Iterator over the new string
    3. Copy each item in the list.

    There may be other ways, too, but that’s my normal approach.

    Steve