Using wildcard on filenames

erick13

New Member
I'm opening files from a browser which I have to attach to. For some reason, sometimes, the filename changes (example: normal filename is filename.txt, unusual filename is filename(1).txt.

I understand that this happens when you open the same file from a site. So I tried to use wildcard on my data item (example: filename*.txt) but this doesn't work.

Any advise?
 

sahil_raina_91

Active Member
If you are trying to open a file by providing wildcard in name, it won't work.
You need to give exact name to open a file.

You can instead try to delete the file "filename.txt" once you are done with it, and then download next file (to avoid filename(1).txt being created)
 

erick13

New Member
If you are trying to open a file by providing wildcard in name, it won't work.
You need to give exact name to open a file.

You can instead try to delete the file "filename.txt" once you are done with it, and then download next file (to avoid filename(1).txt being created)

Im not trying to open it. Im just attaching to it. Does that make any difference?
 

sahil_raina_91

Active Member
Attaching to the file should work with wildcards.
Please test with *filename* instead of filename*.txt

If it doesn't work, post a screenshot with the inputs of attach action and the window title visible.
 

erick13

New Member
Attaching to the file should work with wildcards.
Please test with *filename* instead of filename*.txt

If it doesn't work, post a screenshot with the inputs of attach action and the window title visible.

It did not work. Just to add, my requirement changed from .txt to .xls. I am using the "attach to workbook" from MS excel VBO. I attached the screenshots with error.
 

Attachments

  • attach to workbook.jpg
    71 KB · Views: 37
  • error.jpg
    22.7 KB · Views: 27

sahil_raina_91

Active Member
Hello
how to handle wildcards in filename.
Exemple: "Filename 22092020.xls" error "Filename*"&".xlsx"

If you are using Open Workbook action of MS Excel VBO, there exists NO way to open a file with wildcards.
Open workbook requires full filepath.

However, to handle wildcards in filename :
Use Get Files action in Utility - File Management VBO (give pattern as "Filename*.xlsx")
In the output collection, a column named Path will have the full file path.
Pass the [output collection.PATH] in Open Workbook action
 
Top