I’m trying to read a text file, and then break it up by each line thats is split by a “\n”. Then Regex it and write out the regex.
string contents = File.ReadAllText(filename);
string[] firefox = filename.Split("\r\n");
string prefix = prefix = Regex.Match(firefox, @"(\d)").Groups[0].Value;
File.AppendAllText(workingdirform2 + "configuration.txt", prefix);
string[] firefox = filename.Split(“\r\n”); doesnt exactly work.
What I want to do is run a regex foreach line of contents and then write out each line after the regex
So…
filename:
Hero123
Hero243
Hero5959
writes out to:
13
243
5959
Well everybody is suggesting something off the base in which i started. the ending result will be about a 20 line regex with Ints. I’ve got to parse it out line by line.
File.ReadAllLines