My input example text file
92721662,5819.53,2019 - 10 - 10,04332977,5938.30,.00,118.77 -
92721664,5510.56,2019 - 10 - 10,04332978,5623.02,.00,112.46 -
92730321,22805.90,2019 - 10 - 15,04354360,23350.20,.00,544.30 -
The last regex I have tried is:
var requestbody3 = Regex.Replace(requestbody2, @" { 3 ,}[\r\n]", "");
Where requestbody2 is the result of File.ReadAllText() from "testinput.txt" file
The goal is to remove only the blank lines containing 3 or more spaces ending with \r\n leaving individual lines without gaps between them.
File.ReadLines().Where(!string.IsNullOrWhiteSpace)instead? Regex seems overkill for this