Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I need to fix this code as follows.
Let both space and tab key be processed in the delimited file.
can i fix this?
Thanks in advance for the help friend.
string[] lines = File.ReadAllLines(filePath);
string[] values;
for (int i = 0; i < lines.Length; i++)
{
values = lines[i].ToString().Split(' ');
string[] row = new string[values.Length];
for (int j = 0; j < values.Length; j++)
{
row[j] = values[j].Trim();
}
dataGridView1.Rows.Add(row);
}
Solved! Go to Solution.