Have to search for the first "D " in a multiple line and than get the characters of the position 14-22 in that line

Have to search for the first "D " in a multiple line and than get the characters of the position 14-22 in that line.
For Example: Text file
H TEST PLAN
D E492043543 00123456FTA HLDFGH
D E492043543 00456325111M IUYT
C 4928400000

Final Output : 00123456(from the 1st "D " Line)

@VinothComplee
we can do with string methods/Linq or with regex. Lets assumed the test lines are splittable by new line (\n…)

give a try on using an assign
left side: FirstDNo DataType:String
right side

YourTextVar.Split({Environment.NewLine},StringSplitOptions.RemoveEmptyEntries).Where(Function (x) x.StartsWith("D")).Select(Function (s) s.Substring(14,12)).First()
3 Likes

It is working thank you!!!

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