Wildcard help

Hello,

I have an argument inside orchestrator that is defined as “File.txt”. The bot is looking for emails with attachments named “File.txt”. The attached files are now going to be name FileMMDDYYY.txt. Can someone please help me add a wildcard to the file for the date?

File*.txt doesn’t seem to be working.

thanks,

Tim

@timothy.mullady Can you change the published code? I can suggest a solution but for that, you have to change the code a bit and add an assign activity is that okay for you?

Regards,
Ajay Mishra

Hi @timothy.mullady ,

Step 1 : Set the asset value as “Filex.txt” in orchestrator.

Step 2 : Use Get asset activity to obtain tha value fro. Orchestrator asset and keep a string variable to store the output of the activity (AssetValue)

Step 3 : Use an assign activity, LHS the variable in which you want to store the file name

RHS(Use the expression like below)
AssetValue.Replace(“x”,DateTime.now.tostring(“MMddyyy”))

This should make the file name dynamic.

Hope this helps.

Thanks,
Gautham.

Hello @timothy.mullady

You can overwrite the argument value with the assign activity by giving argument name Assign Activity To= “argument name” and Value = “File”+Now.ToString(MMddyyyy)+“.txt”

1 Like

Hello,

I’m sorry for the confusion but I’m not trying to store the file name in that format. Someone sends emails with attachments named File.txt to a email box. The robot then searches for the file and stores them in a local folder. I’m asking the sender to add a datestamp the the file name so each file is unique.

I want the search to be based on “File”*“.txt” The date portion of the string would be a wildcard

Thanks,

Tim

Hi @timothy.mullady ,

You can make use of Save Email Attachments activity , this activity has a property that allows you to filter based on name of the attached file. You can use same expression “File*.txt” in the field filter by name.

Attaching a sample image, instead of .xlsx try using the File.txt

Hope it helps you.

Thanks,
Gautham.

This is screen shot of my argument in Orchestrator. I’m just trying to add a wildcard for for the date portion of the new file name format.

image

I’ve tried
^file\d{6}.txt$
file*.txt
file&“*.txt”

Hi @timothy.mullady ,

Not sure. Can you test with the value written directly inside module just to check if it is working with wild card.?

Thanks,
Gautham.

If you know what the filename will be, why are you using an argument?

I would use “File*”
That’s it.
Nothing after the wildcard.