Regex expression Error

OCR Output.txt (1.7 KB)


How we can Create Regex Expression for this Text file ?( In pic red line shows string to be extract)

@Makrand_Damugade

Can you please try this

System.Text.RegularExpressions.Regex.Matches(str,"(?<=0000\d{2})(.*\n){4}",System.Text.RegularExpressions.RegexOptions.MultiLine)

str is where you would have your string from notepad

cheers

1 Like

Hi,

Another approach:

Can you try the following sample?

mc = System.Text.RegularExpressions.Regex.Matches(strText,"\n\d+\s+(?<VALUE1>.*)[^\S\r\n]+[\d.,]+[^\S\r\n]+[\d.,]+[^\S\r\n]+[\d.,]+\r?\n(?<VALUE2>[^\r\n]*)\r?\n(?<VALUE3>[^\r\n]*)\r?\n(?<VALUE4>[^\r\n]*)(?=\r?\n)")

then mc(0).Groups(“VALUE1”).Value returns VALUE1 part, and finally this outputs the following sheet.

Sample20230617-1aL.zip (3.9 KB)

Regards,

Thanks You…It helps me lot.

1 Like

Thank You Sir for your FeedBack.

1 Like