I do have have 4 columns within my CVS file, the first two columns have 2 empty rows. I would like to skip these empty rows. I know that I have to loop through the file however I do not know how to do this process.
Any suggestions would be appreciate it.
public class Program
{
static void Main(string[] args)
{
var filePath = Path.Combine(Directory.GetCurrentDirectory(), "Santander .csv");
var fileContents = ReadFile(filePath);
foreach (var line in fileContents)
{
Console.WriteLine(line);
}
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
public static IList<string> ReadFile(string fileName)
{
var results = new List<string>();
var target = File.ReadAllLines(fileName).ToList();
return results;
}
}
As you can see in this image I would like the the commas at the beginning to be removed and only display rows who contains data inside the column.
