12-14-2021 06:21 AM
Hi,
I am using Multi File reader snap but is not picking correctly filename if it has curly brackets.
filename is like: abcd{334-ffg-gg}.xml
How to handle these kind of schenarios.
12-14-2021 08:02 AM
Directory:
$[“content-location”].substring(0, $[“content-location”].lastIndexOf(“/”) + 1)
File filter:
$[“content-location”].substring($[“content-location”].lastIndexOf(“/”) + 1).replaceAll(" “,”%20")
12-14-2021 12:48 PM
I believe this is happening because of your curly brackets in your file name because the “File filter” field I think it is using a regex pattern to search for the file. You need to escape the special characters in the file name. To do this you can use the following expression:
$filename.replace(/\W/g, (matched) => "\\".concat(matched))
The \W regex pattern here will search for all non-word characters in your string. Then with the (matched) function we target those non-word characters and we add the string "\\"
before the special character to escape it. After this the search criteria will be: 'abcd\{334\-ffg\-gg\}\.xml'
In your case the expression would be:
$["content-location"].substring($["content-location"].lastIndexOf("/") + 1).replaceAll(" ","%20").replace(/\W/g, (matched) => "\\".concat(matched))
12-14-2021 04:59 PM
Hi, still ile size($[“Size (in bytes)”]), date($[“Update date”]), path ($Path) coming as null.
did you try at your end? has it worked for you?
12-15-2021 12:30 AM
They are good on my end.
You can get the file size from content-length
header from the file reader as well. I’m not really sure why these values are null in your case. Are you reading from an SFTP location ? Can you share the data before/after the Directory Browser ?
12-15-2021 03:43 PM
Hi,How do I get size, date, path from content-length
header ?
what is the expression to use in mapper?