从Excel导出到.txt文件[C#] [英] Export From Excel Into .txt file [C#]

查看:118
本文介绍了从Excel导出到.txt文件[C#]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问候



尊敬的各位成员,我一直在网上查看,但是,我没有一个类似的问题,所以我想问一下,对于其他人来说可能会派上用场,所以我在这里:



我有两列和+800,000行的巨型excel文件,过程如下:

我根据第二列进行过滤(因此第二列上有许多类似的数据),然后在过滤后,我复制第一列并将其粘贴到记事本文件(.txt)上并更改其名称到第二个列过滤器。

[Summery]

输入:Excel文件

输出:多个.txt文件



如果我这样做需要花费数小时和数小时,所以我想也许你可以指出我正确的方向,然后我自己休息。



提前谢谢你,

Greetings

Dear members, I've been checking out on internet, however, i didn't a single similar question, so i thought to ask it, may come handy for someone else, so here i go:

I have this giant excel files with 2 columns and +800,000 rows, the process is like this:
I am Filtering based on the second column(so there are many similar data on second columns), then after filter, i copy the first column and paste it on a notepad file(.txt) and change its name to second's column filter.
[Summery]
Input: Excel File
Output: multiple .txt files

if i do this by hand would take hours and hours, so i thought maybe you can point me into a right direction, then rest i do myself.

Thank you in advance,

推荐答案

你可以在任何地方找到大量的信息。例如,您可以使用Microsoft.Jet: https://en.wikipedia.org/wiki/Microsoft_Jet_Database_Engine [ ^ ]。



以下是其中一个代码示例:

https://social.msdn.microsoft.com/Forums/vstudio/en-US/a6ceb8be-b633-4fff-88e0-1692206e2db2/c-excel-to-文字转换 [ ^ ]。



另一种方法是使用 Microsoft.Office.Interop.Excel ,还有一个将使用Microsoft Open XML SDK。你会发现很多代码示例。 [结束编辑]



但我会再说一遍:你将如何处理文本?它在我看来是一种非工程方法,试图从用户级手动工作中获得更多。事实上,有人把大量的数据放在Excel,办公人员的工具中,告诉尾巴。拜托,没什么个人的。我可能会在这里弄错,但你试图发挥侮辱卡只能证实这一点。如果我错了,就解释一下。无论如何,你得到了解决方案。



-SA
You could find plentiful of information anywhere. For example, you could use Microsoft.Jet: https://en.wikipedia.org/wiki/Microsoft_Jet_Database_Engine[^].

Here is one of the code samples:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/a6ceb8be-b633-4fff-88e0-1692206e2db2/c-excel-to-text-conversion[^].

Another approach is using Microsoft.Office.Interop.Excel, and one more would be using Microsoft Open XML SDK. You will find plenty of code samples. [END EDIT]

But I'll repeat: what you are going to do with the text? It looks to me as a non-engineering approach, the attempt of getting a little further from the user-level manual work. The mere fact that someone put the huge amount of data in Excel, office personnel's tool, tell the tail. Please, nothing personal. I could be mistaken here, but your attempt to play the "insult" card only confirms that. If I'm mistaken, just explain that. Anyway, you got the "solution".

—SA


这篇关于从Excel导出到.txt文件[C#]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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