File List - Strange behaviour with spaces

Discuss RoboTask here
Post Reply
Rukbunker
Posts: 212
Joined: Mon Feb 22, 2016 4:06 pm
Location: Netherlands

File List - Strange behaviour with spaces

Post by Rukbunker »

Hey Oleg,

For a task I need 2 JPG files which are being modified by ImageMagick. This works, but the error occurs already in the beginning of fetching the files.
An importfolder is being monitored by a File Trigger. After 1 first JPG is detected, the task starts and waits for 5 seconds until the second one arrives.
The Search For Files action, should create a list of the 2 files. Robotask tries that and works, but when spaces in the filename are occuring, that is screwing things up ;) For sure, the solution would be to use no spaces, but that's another discussion (we are dealing with people here), and technically...it should work....right?

The 2 files:
KNipsel.PNG
KNipsel.PNG (11.16 KiB) Viewed 14725 times
Creation of the list:
Knipsel2.PNG
Knipsel2.PNG (21.47 KiB) Viewed 14725 times
The Log Message shows me this: (I'm using: Links: {LIST(0)})
Knipsel5.PNG
Knipsel5.PNG (30.89 KiB) Viewed 14725 times
It looks likes it goes wrong at the first space. The second file (called with {LIST(1)}) is only displaying a "-".

What do I miss here? Using brackets (like ") before and after the filename doesn't solve this issue....
Oleg
Site Admin
Posts: 3137
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: File List - Strange behaviour with spaces

Post by Oleg »

t looks likes it goes wrong at the first space. The second file (called with {LIST(1)}) is only displaying a "-".
Search for files action creates a multiline text (not comma separated string)
So the variable LIST contains the text with two lines (in your case)
You need to use Text loop to process your files sequentially

If you want to retrieve file name by line number use TXT Extract Line action

Also if you want to use comma-separated string use TXT Comma-Text Conversion action

By the way: by default, the space character is a data separator, like a comma in a standard comma-separated string.
Oleg Yershov
Rukbunker
Posts: 212
Joined: Mon Feb 22, 2016 4:06 pm
Location: Netherlands

Re: File List - Strange behaviour with spaces

Post by Rukbunker »

Makes sense. Thanks Oleg!!
Post Reply