Forum Discussion

jhagist's avatar
jhagist
New Contributor III
7 years ago

Wild Card at end of variable - parameter

I am using a delete file snap and would like to delete all files that start with a name stored in a parameter.

Ex. controlfile1.json // controlfile2.csv

How would I put a wildcard at the end of the parameter?

_parameter1 (what goes here?)

5 Replies

  • jhagist's avatar
    jhagist
    New Contributor III

    Thank you… that pointed me in the right direction. What follows works but isn’t real pretty. Would love any suggetions for improvement.

    Here is the entire pipeline

    The Directory Browser is set up like this. (Top one is for the json and bottom is csv)

    The mapper takes the parameter to select the files i want to delete.

    Filter out the files I don’t want.

    Then the delete.

  • Schevus's avatar
    Schevus
    New Contributor III

    You should be able to do something like this:

    _parameter1 + “*.json”

    Making sure to check the expression evaluation toggle.

  • jhagist's avatar
    jhagist
    New Contributor III

    Thanks for the feedback. I was looking for something more like this. (This doesn’t work)

    • Schevus's avatar
      Schevus
      New Contributor III

      Sorry, looks like you are correct. Perhaps do your filtering in a directory browser, and then grab the filenames from the results to be used in the delete snap?

  • Schevus's avatar
    Schevus
    New Contributor III

    Seems like an enhancement request for wildcarding in the delete snap may be in order! 🙂 Glad you got something working, though.