Forum Discussion

Sahil's avatar
Sahil
Contributor
4 years ago

Curly brackets in filename

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.

17 Replies

  • Hi @Sahil,

    What do you mean by “not picking correctly the filename if it has curly brackets” ? Does it throw any errors ? I’m pretty sure that you can read a file with a name like ‘abcd{334-ffg-gg}.xml’ without any problems.

    • bojanvelevski's avatar
      bojanvelevski
      Valued Contributor

      I agree:

    • Sahil's avatar
      Sahil
      Contributor

      Hi,
      My pipeline is like below:-

      and use the content-location & content-disposition in child pipeline.
      But it is passing file as abcd_334-ffg-gg_.xml

      • j_angelevski's avatar
        j_angelevski
        Contributor III

        @Sahil,

        If you are trying to get the name of the file in the child pipeline, you can pass the content-location header. I don’t know where are you reading the file from, but if it’s SLDB, the header value should look like this:

        And if you want to get the filename only, you can use this expression: $['content-location'].split("/")[$['content-location'].split("/").length - 1] this will return the name of the file.

  • dmiller's avatar
    dmiller
    Former Employee

    Do you happen to have the expression toggle (the button with = sign) selected?