I've read a file from a text file and parsed the data I want, but I don't know how to save the parsed data in form to the file. Are you able to assist me? I've also included a snippet from the file. https://ibb.co/G5hTtky --> link for the image
public static void Main(string[] args)
{
StreamReader streamReader = File.OpenText(@"C:\Users\asr050322.txt");
string text = streamReader.ReadToEnd();
string[] linesArray = text.Split("BOH");
for (int i = 0; i < linesArray.Length; i++)
{
if (linesArray[i].Substring(24, 5) == "UXOAP")
{
File.WriteAllLines(@"C:\Users\HeUXOAP050322.txt", Array.ConvertAll(linesArray[i], x => x.ToString()));
}
if (linesArray[i].Substring(24, 5) == "UXOGS")
{
File.WriteAllLines(@"C:\Users\UXOGS050322.txt", Array.ConvertAll(linesArray[i], x => x.ToString()));
}
}
}