如何使用c#将excel文件中的内容读入文本文件? [英] How to read contents from an excel file into a text file using c#?

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

问题描述

我正在尝试复制具有空白单元格的Excel工作表的内容。我希望将内容以CSV格式存储在文本文件中。我想搜索一下找出一个excel条目并为它提出一个标志值。换句话说,我想在上传后立即在excel表中计算值的出现次数(字符串val表示hello_1)。另外,我想创建一个窗体表格,用于上传excel表格,然后显示出现的计数值。

任何建议??

解决方案

这是经常被问到的问题。请参阅我以前的回答:如何在c#中点击按钮后,在Excel工作表中获取sql表列[ ^ ]



你读过代码项目快速解答常见问题解答 [ ^ ]?可能不是。下次,请使用 SearchBox [ ^ ]在本网站的右上角。

I am trying to copy contents of an excel sheet having blank cells as well. I want the contents to be stored in CSV format in a text file. I want to then search over find out one of the excel entries and raise a flag value for it. In other words, I want to count the number of occurences of a value (string val say "hello_1") in my excel sheet as soon as I upload it. Also, I want to create a windows form for uploading the excel sheet and then displaying the occurence count values.
Any suggestions??

解决方案

This is quite often asked question. Please see my past answer: How to get sql tables columns in excel sheet after click button in c#[^]

Have you read Code Project Quick Answers FAQ[^]? Probably NOT. Next time, please use SearchBox[^] at the right-top corner on this site.


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

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