How to extract 10 different matching text details and table info from Text file

Hi All,

How to extract multiple lines of matching text details and table info from text file.
I want to extract 10 different searching details from the text file. End i want to move all the details to Excel. Please help me with the build, it would be great help if any sample workflow attached here. Thanks in Advance.

  1. I want to extract where ever “Con Note” and “Scale” found
  2. Table details between closing data and opening data info, It is actually table note sure how it look like in excel in final output.
    Sample Data.txt (482 Bytes)

Expected Output:-
Con Note Expires on 23-OCT-2023
Scale to DPI : undefined
Con Notes Expires on 12-Sep-2023

Compay Code Des Amount Comm

CD Private CN1 OR UN Fully Paid 3.0 US
Globla MARKET YMTKL2 Ordinary Fully Paid 200 UK

Regards,
Niranjan

We can’t help if you don’t give us any details. Show us the file. Show us what you want from the file.

@postwick sorry I cannot attach internal details. But from notepad I want to extract 5 or 10 different search details to excel. if any table found in search I want to move same details to excel. Thanks a lot in quick reply.

Hi @Niranjan_k

As @postwick suggested, it is not possible to visualize the problem statement without sufficient data & hard to draw the solution. Could you please share the dummy files or sample input & expected output details, so that the solution can be provided?

Best Regards.

@arjunshenoy @postwick I have created Sample data please find the attached file.

  1. I want to extract where ever “Con Note” and “Scale” found
  2. Table details between closing data and opening data info, It is actually table note sure how it look like in excel in final output.
    Sample Data.txt (482 Bytes)

Expected Output:-
Con Note Expires on 23-OCT-2023
Scale to DPI : undefined
Con Notes Expires on 12-Sep-2023

Compay Code Des Amount Comm

CD Private CN1 OR UN Fully Paid 3.0 US
Globla MARKET YMTKL2 Ordinary Fully Paid 200 UK

@arjunshenoy @postwick Any Suggestions please.

One of many options: Regex


[CheatSheet] - System.Text.RegularExpressions | RegEx - News / Tutorials - UiPath Community Forum

In some cases the strategy of ReadLines / Linbreak Split and filtering can be rated as an alternate as well

@ppr Could you please help me to build UiPath workflow how can I read match data and table details to the excel. Thanks in Advance.

Hi @Niranjan_k

Can you try this

Read Text File into strText

  • Use Matches activity with pattern “Con Note.|Scale.” on strText and store in matchesConNoteScale

Initialize outputString = “”

  • For Each match in matchesConNoteScale
    • Append match.Value to outputString

Use Build Data Table to create a DataTable with columns for ‘Con Note’, ‘Scale’, ‘Company’, ‘Code’,Etc

  • Split outputString into lines and use Add Data Row for each relevant line
  • Use Excel Application Scope and Write Range to output the DataTable to Excel

Hope this helps

@sanjay3 Im new to UiPath can you help me with the sample workflow.

@ppr Im not able to extract table details. Dynamically table will update with number of rows. i just want to extract data between Closing data and Opening data. Any suggestions please.

@sanjay3 Can you help me with Any example how to get the table details from notepad.