1

我想将文件行插入到 excel 工作表中,但它不关心格式,如果我从剪贴板手动粘贴它就可以了。

input.txt
aaaaaaa 1234567 12345678
bbbbbbb 1234567 12345678
ccccccc 1234567 12345678
dddddd 1234567 12345678

string[] exp = File.ReadAllLines("input.log");
for (int i = 0; i < exp.Length; i++)
            {
                //tbDebug.Text += "\r\n" + exp[i];
                xlWorkSheet.Cells[i, 1] = exp[i];
            }

我如何插入单元格以保持格式如
ABC
aaaaaa 1234567 12345678

4

1 回答 1

0

You just create one cell. You have to split the string first and then add multiple cells for every line in the log file.

于 2013-09-06T12:44:21.083 回答