Please guide me about read text file

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

image
data.txt (166 Bytes)

2 Likes

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

grafik
taking the group 1 info:
grafik

also have a look here:

3 Likes

@ppr If i want read out only (after line out)
Please guide me about it.

image
data.txt (272 Bytes)

@fairymemay
for a first go you can try with a substring on the OUT part assumed it is present after the IN Part
grafik

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)

@Vishal_K

I have question about code.
What is columnSizes?

image

@fairymemay

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.
image

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

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 :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

2 Likes

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