Posted 12 July 2020, 11:43 pm EST
Hi Remus,
You can use the code snippet given below to save the data from the text file into the array so that you save load it into the table:
String input = File.ReadAllText(@"Data.txt");
int i = 0, j = 0;
var rows = input.Split('\n');
string[,] result = new string[rows.Count(), 7];
foreach (var row in rows)
{
j = 0;
foreach (var col in row.Trim().Split('#'))
{
if (j < 7)
{
result[i, j] = col.Trim(new char[] { '"'});
j++;
}
else
{
break;
}
}
i++;
}
Please go through the following link to learn how to create the table in the word file via code:
https://www.grapecity.com/documents-api-word/docs/online/table.html
If you need any other help, please let us know.
Regards,
Prabhat Sharma.