I want to read text file (.txt)
If reported = 2 days
I want to copy data (red square) to excel.

data.txt (166 Bytes)
I want to read text file (.txt)
If reported = 2 days
I want to copy data (red square) to excel.

data.txt (166 Bytes)
@fairymemay
can be done with regex / Match activity
(CAAYUTIUJIUU\d{5})(.*)(?= 2 days)

taking the group 1 info:

also have a look here:
@fairymemay
for a first go you can try with a substring on the OUT part assumed it is present after the IN Part

Hi @fairymemay
Please run this xaml file which would serve your requirement.
The workflow will read the data.txt, convert it into datatable and then save it into excel with two sheets. Refer the xaml where I have written the annotations for your understanding and also check the excel output generated
fairymemay.zip (2.5 KB)
I have assigned this variable at top of the code, it means columns taking from txt file the argument passed are character length first column has 4 character that is column 1 will have field name = “file”
ReadText_2dys.xaml (6.2 KB)
Sample
Hi @fairymemay
I have created the workflow which will give the data after the OUT keyword as shown in SS below.

After that it will give the specific code which has 2 days in it by applying below regex

MainPratik.xaml (10.8 KB)
temp.txt (260 Bytes)
Hope this help you now. By this your workflow will work.
Mark as solution and like it ![]()
Happy Automation ![]()
Best Regards
Er Pratik Wavhal ![]()
![]()
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.