Skip to content

Instantly share code, notes, and snippets.

View abdulateef's full-sized avatar

Abdulateef abdulateef

  • sekat technologies
  • Lagos Nigeria
View GitHub Profile
@abdulateef
abdulateef / LoadCSV.cs
Created July 2, 2017 07:53
how to load a CSV value from a text file with the column head into a datagridview using c#
public static string[,] LoadCsv(string filename)
{
//get the file text
string text = System.IO.File.ReadAllText(filename);
//split into Lines
text = text.Replace("\n", "\r");
string[] lines = text.Split(new char[] { '\r' }, StringSplitOptions.RemoveEmptyEntries);
// to get how many rows and columns