Regex to get Line by line data

Hello All,

I need to get the row by row information using regex.

Now i have the regex to get the data that i need but it returns only one line if there is multiple data (data in immediate next row) under each section. But it returns all the data if there is a separation (some other information) between each row.
I have attached the XAML and Sample data for reference.

Thank you!

TEST1.xaml (20.4 KB)
Actual Data.txt (13.1 KB)

Hi @Ice ,

Can you let us know what actually you want to extract from the above text file? so that we can help you.

Hi @Manish540,

Thank you for you quick response !

Below are the data that i want. I have got all the info using the attached XAML, but its not providing if the data is continuous. Please check my sample code and input file, Its return the output but only issue is continuous lines.

  1. Need to split the data from 1ABCD123 till (before next 1ABCD123) – save as different set of data

  2. Read the line 1 “RUN DATE” - Position 120- 131

  3. Line 3 - “AMOUNTIS ITEM LIST” (Alphabets) no of alphabets may differ for each file

  4. Line 4 - “ABCDEFG12” (Alpha numeric value)

  5. Line 5 “File NO” - Position 17-20

  6. Line 6 - PAID DATE: “OCT 25,2022” (Date)

  7. Line 7 “ABC FILE ID” - Position 22-34

  8. Line 10 - "LIST OF ITEMS " (Alphabets) no of alphabets may differ for each file

  9. Read all the Items separately in the Line 16 – Ex: ABD TYPE, OTHER NUM, STUDENT ID NO, STUDENT NAME - Position 3, 20-31, 32-39, 45-75

  10. Read all the Items separately in the Line 18 – Ex: ABD TYPE, OTHER NUM, STUDENT ID NO, STUDENT NAME- Position 3, 20-31, 32-39, 45-75
    After Line 16, data can be in the line 18 or 19 or any lines so I need to pass dynamic line item after 16 and get data to validate if its required or need to move to next line
    Same set needs to be repeated for next set of data (From next 1ABCD123)

  11. Successful Extraction: If the row is not one by one, I can see the out properly. For Ex: If there is “TOTAL REASON FOR CODE” is in between the two rows then the next line of data will be extracted.

  12. Failed : If the row is one by one then its extracting the first data and moving to next after some other data -

1 Like