如何将文本文件写入excel文件 [英] How to write text file to excel file

查看:93
本文介绍了如何将文本文件写入excel文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有如下文本文件,我想将其转换为excel。

i have text file like following, i want to convert it to to excel.

4|4|Cor|D|CA ABANDONED|147| 167982.71|LKR |167982.71|
4|4|Cor|D|CABANK |CA - BANKS |1|34719.32|LKR | 34719.32|
4|4|Cor|D|CACOLL |COLLECTION ACCOUNTS |56|21253312.77|LKR |21253312.77|
4|4|Cor|D|CACORP|CURRENT CORPORATION |58|381977297.64|LKR |381977297.64|





我尝试了什么:



i一行一行地尝试追加。但是浪费时间。



What I have tried:

i tried line by line appending.but it is time wasting.

推荐答案

只需在'|'字符上使用spliter并使用该数组以excel简单方式填充单元格

@ 使用C#向Excel写入数据
Just use spliter on '|' character and use that array to fill cell in excel simple way as done
@Write Data to Excel using C#


这篇关于如何将文本文件写入excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆