Download Multiples Files

Hello … I would like to have a file with multiple lines, where each line would contain a name, following the example:

NAME1.txt
NAME2.txt
NAME3.txt

How do I make a loop to read the file and download via FTP the files contained within it?

I use something like this. It loops through the file line by line and saves the line as a variable. Then you can use the variable however you want. To download via ftp, use fetch:
:local content [/file get [/file find name=file.txt] contents];
:local contentLen [:len $content];

:local lineEnd 0;
:local line “”;
:local lastEnd 0;

:while ($lineEnd < $contentLen) do={

depending on file type (windows/linux), “\n” might need to be “\r\n”

:set lineEnd [:find $content "\n" $lastEnd];

if there are no more line breaks, set this to be the last one

:if ([:len $lineEnd] = 0) do={
	:set lineEnd $contentLen;
}

get the current line based on the last line break and next one

:set line [:pick $content $lastEnd $lineEnd];

depending on “\n” or “\r\n”, this will be 1 or 2 accordingly

:set lastEnd ($lineEnd + 1);

don’t process blank lines

:if ($line != "\r") do={
	/tool fetch address=192.168.1.1 src-path=$line user=USER mode=ftp password=PASS port=21;
}

}