@George Tyrebyter , Welcome to Microsoft Q&A,
One way I was thinking of processing the text file would be to look for each line that has "3D PRED" and take the value to right of it which follows.
According to your latest description, you could try to use the following code to get what you wanted.
string []lines = File.ReadAllLines("test.txt");
List<string> list = new List<string>();
foreach (var item in lines)
{
if(item.Contains("3D PRED"))
{
int index = item.IndexOf("3D PRED");
string []result = item.Substring(index+ "3D PRED".Length).Split(' ').Where(i=>!string.IsNullOrEmpty(i)).ToArray();
list.Add(result[0]);
}
}
list.ForEach(i => Console.WriteLine(i));
txt file and result:
Best Regards,
Jack
If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.