How to read a txt file based on partial file name

Hi All,

I want to Read a txt file. The file name is dynamic particular text only static…

ex:
C:\stateName_vendor.txt

here stateName is Dynamic

1 Like

no worries
arr_in_folderpath = Directory.Getfiles(“yourfolderpath”,"*_vendor.txt")
or
arr_in_folderpath = Directory.Getfiles(“yourfolderpath”,"*.txt")
this will give the array of only txt files from the folder path mentioned
where arr_in_folderpath is a string array variable
– we can pass this to a for each activity and change the type argument as string in the property panel of the for each activity
–inside the loop use READ TEXT FILE ACTIVITY and mention the input as item

hope this would help you
Cheers @sweth

1 Like

arr_in_folderpath = Directory.Getfiles("yourfolderpath","*vendor.txt")

Regards,
Arivu

1 Like

Hi @sweth

I have created workflow based on requirement please run and check, before run this workflow in assign activity please change the path where you save this workflow.

TextFileOpen.zip (12.3 KB)

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.