Hello All,
I have Attached the text file here data as a text here. I need to split the data from ABCDE123 before ABCDE123 of next item and then read specific value from each line item. I have the position of each data. Ex: Line 9: Position 11-13 for File name(AAA). I need to pass dynamic line value and check if there is a data.
I have tried YourStringVariable.Split(New String() {Environment.NewLine},StringSplitOptions.None), but this returns System.String though the variable is array of string.
strAfterAmoutItemList = System.Text.RegularExpressions.Regex.Match(currentItem.Value.Trim,“(?<=^(.\r?\n){3}).”).Value.Trim - What “{3}” refers to
^(.*\r?\n){3} matches 3 lines from the beginning of the string. So (?<=^(.*\r?\n){3}).* returns 4th line.
(?<=(.*\r?\n){2}\s*\S.*?\s{2,}) matches 2 lines from the beginning of the string and words before 2 or more spaces. So, (?<=(.*\r?\n){2}\s*\S.*?\s{2,})\S.*(?=\r?\n) returns string after “some words and 2 or more spaces” in the 3rd line