Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
-
Joerg
- Posts: 32
- Joined: Wed Dec 19, 2012 9:57 am
Hello,
I try to put a file list into message text. If I use a filelist var I've got the complete path and file name. With a loop I concat the single filenames (name attribut) into a string var. Additional a new line and CR cahr. But if i put this var into my mail message text, there is no CR.
How can I produce a little tab with the filenames within message text?
with regards
Joerg
-
Jonathan
- Posts: 18
- Joined: Wed Jan 02, 2013 5:27 am
- Location: Mapledurham, UK
-
Hi Joerg,
You can try this project, It will loop through the files in a path and return a variable called files which contains all of the files with a tab at the start and CRLF at the end.
Code: Select all file.txt
test.pub
create.sh
as2testfile.txt
files.xml
Project.log
list.csv
testFile.txt
Code: Select all<project name="Filenames with tabs" mainModule="Main" version="2.0">
<module name="Main">
<createFileList fileListVariable="fileList" version="1.0">
<fileset dir="${path}" />
</createFileList>
<forEachLoop itemsVariable="${fileList}" currentItemVariable="thisFile">
<setVariable name="files" value="${Concat(files,system.tab, String(thisFile:name), system.carriageReturn, system.lineFeed)}" version="2.0" />
</forEachLoop>
<sendEmail resourceId="SMTP_Resource" toList="[email protected]" version="2.0">
<from address="[email protected]" />
<subject>
<![CDATA[SOME_SUBJECT]]>
</subject>
<message>
<![CDATA[${files}]]>
</message>
</sendEmail>
</module>
<variable name="path" value="/home/" description="Path to files" />
<variable name="files" value="" description="Our list will end up here" />
</project>
-
Joerg
- Posts: 32
- Joined: Wed Dec 19, 2012 9:57 am
Hi Jonathan,
many thx, I tried it with '/n' without success.
Your code works and helps.
bye
joerg