C#提取物通过OLEDB格式的文本从Excel

编程入门 行业动态 更新时间:2024-10-28 07:30:01
本文介绍了C#提取物通过OLEDB格式的文本从Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我从一个大的已经格式化了文本 Excel中文件中读取数据。我提取数据到数据表通过对象的OleDbConnection &安培; 于GetOleDbSchemaTable 。但所提取的数据不包括任何格式的信息。

我的要求是,我需要提取唯一的非删除线的文本。

我没有任何问题的同时阅读和一切是完全没有问题。但我的提取应 Excel中这我无法找到解决方案是基于文本格式。

什么要在添加的的connectionString 这是如下:

的connectionString =供应商= Microsoft.ACE.OLEDB.12.0;数据源=+文件名+;扩展属性= \的Excel 12.0的Xml; HDR = YES;模式=读;只读= TRUE; \;

约束:

  • 使用的OleDbConnection - 无互操作

  • 从阅读中DataTable对象

  • 解决方案

    要尽我所知,你不能只用ACE驾驶员做到这一点。话虽这么说,如果约束不断提升,这是使用工具: 的http:// closedxml。 codeplex/

    I am reading data from a large excel file which has got formatted texts. I extract the data to DataTable object through oleDBConnection & GetOleDbSchemaTable. But the extracted data doesn't include any formatted information.

    My requirement is, I need to extract only non-Strikethrough texts.

    I don't have any issues while reading and everything is perfectly fine. But my extraction should be based on text format in excel which I am unable to find the solution.

    Anything to be added in the connectionString which is as follows:

    connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + fileName + "; Extended Properties=\"Excel 12.0 Xml;HDR=YES;Mode=Read;ReadOnly=True;\"";

    Constraints:

  • Using OleDBConnection - No Interop

  • Reading to DataTable Object

  • 解决方案

    To the best of my knowledge, you cannot do this with just the ACE driver. That being said, if the constraints are ever lifted, this is the tool to use: closedxml.codeplex/

    更多推荐

    C#提取物通过OLEDB格式的文本从Excel

    本文发布于:2023-10-04 20:26:07,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1467210.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:提取物   文本   格式   Excel   OLEDB

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!