Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Main()
- {
- var matches = Regex.Matches(File.ReadAllText(@"C:\Users\Vasaka\Desktop\example_ndisprot.txt"),
- @"(?<name>\w+):\sEnd,?\s(?<val>\d{6})");
- (from Match match in matches
- group match.Groups["val"].Value by match.Groups["name"].Value)
- .ToList()
- .ForEach(grp => File.AppendAllText(grp.Key+".txt",string.Join("\n",grp.Select(x=>x))));
- }
Add Comment
Please, Sign In to add comment