可以用npoi:

http://npoi.codeplex.com/

把npoi.dll放在unity里即可。

读取代码:

using System.IO;
using NPOI.SS.UserModel;
using NPOI.HSSF.UserModel;

using (FileStream stream = File.Open(m_excelPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
  IWorkbook book = new HSSFWorkbook(stream);

  for (int i = 0; i < book.NumberOfSheets; ++i) {
    ISheet s = book.GetSheetAt (i);
    Debug.Log ("sheetName:"+s.SheetName);
    //s.LastRowNum的索引值,不是行总数,从0开始计数
    for (int k = 0; k <= s.LastRowNum; ++k) {
      IRow row = s.GetRow (k);
      if (null == row) {
        continue;
      }

      //print cell[0]

      ICell cell = row.GetCell (0);
      string cellValueStr= getCellValue (cell);
      Debug.Log ("cellValueStr:"+cellValueStr);
    }
  }

}

protected string getCellValue(ICell cell)
{
  if (null == cell) return "";

  if (CellType.NUMERIC == cell.CellType) {
    return cell.NumericCellValue.ToString ();
  } else {
    return cell.StringCellValue;
  }
}

unity, 读写xls的更多相关文章

  1. java使用POI jar包读写xls文件

    主要使用poi jar来操作excel文件.代码中用到的数据库表信息见ORACLE之表.使用public ArrayList<Person> getPersonAllRecords()获得 ...

  2. 使用poi或jxl,通过java读写xls、xlsx文档

    package nicetime.com.baseutil; import jxl.Sheet;import jxl.Workbook;import jxl.read.biff.BiffExcepti ...

  3. python 读写XLS

    需要库: xlrd, xlwt, xlutils 导入 import xlrd from xlutils.copy import copy 打开文件 data = xlrd.open_workbook ...

  4. MATLAB学习(二)读写xls文件

    >> N=xlsread('DRINK.xls','DRINK','A1:D8') N = 207.2000 3.3000 15.5000 2.8000 36.8000 5.9000 12 ...

  5. Unity 读写文本 文件

    1. LitJson的使用 https://blog.csdn.net/qq_35669619/article/details/78928966 https://blog.csdn.net/qq_14 ...

  6. Excel文件读写操作1(xls)

    一.Python-Excel常用的库:xlrd(read).xlwt(write).xlutils.openpyxl 1.xlrd  读取Excel文件,支持 .xls 和 .xlsx 格式. 2.x ...

  7. 用python读写excel的强大工具:openpyxl

    最近看到好几次群里有人问xlwt.wlrd的问题,怎么说呢,如果是office2007刚出来,大家用xlsx文件用不习惯,还可以理解,这都10年过去了喂,就算没有进化到office2016,还在用of ...

  8. 【转】用python读写excel的强大工具:openpyxl

    最近看到好几次群里有人问xlwt.wlrd的问题,怎么说呢,如果是office2007刚出来,大家用xlsx文件用不习惯,还可以理解,这都10年过去了喂,就算没有进化到office2016,还在用of ...

  9. Python_对excel表格读写-openpyxl、xlrd&xlwt

    openpyxl 和 xlrd&xlwt 都能对excel进行读写,但是它们读写的格式不同,openpyxl 只能读写 xlsx格式的excel,xlrd&xlwt 只能读写 xls格 ...

随机推荐

  1. Qemu文档

    http://wiki.qemu.org/Manual http://qemu.weilnetz.de/qemu-doc.html http://www.linuxcertif.com/man/1/q ...

  2. Get start with Android development

    Firstly we should install the right version of JDK and JRE, there are two version of ADK for differe ...

  3. WPF Step By Step -基础知识介绍

    回顾 上一篇我们介绍了WPF基本的知识.并且介绍了WPF与winform传统的cs桌面应用编程模式上的变化,这篇,我们将会对WPF的一些基础的知识做一个简单的介绍,关于这些基础知识更深入的应用则在后续 ...

  4. MySQL数据库备份和还原的常用命令小结

    备份MySQL数据库的命令 mysqldump -hhostname -uusername -ppassword databasename > backupfile.sql 备份MySQL数据库 ...

  5. url重写技术

    URL 重写是截取传入 Web 请求并自动将请求重定向到其他 URL 的过程.比如浏览器发来请求 hostname/101.aspx ,服务器自动将这个请求中定向为http://hostname/li ...

  6. tablet 的使用

    之前一直用jbrowse  发现有些信息展示的不准确,如浏览一个bam文件的比对情况.在某一位点,深度为1000,但是浏览器显示的小于1000,并且read也经常会缺少.所以果断放弃jbrowse,用 ...

  7. 如何优雅的写C++代码(一)

    // get the greatest power of two that is a divisor of n: return n&-n; // swap two integers a and ...

  8. WebApp远程调试工具

    针对存在内嵌在客户端的webview项目中,在开发过程中我们希望能像PC上一下直接进行调试,提高我们平时的开发效率,这时候我们可以使用webApp远程调试工具-weinre. 安装: 本工具需要nod ...

  9. C++ Primer : 第十一章 : 关联容器之概述、有序关联容器关键字要求和pair类型

    标准库定义了两种主要的关联容器:map和set map中的元素时一些关键字-值(key-value)对,关键字起到索引的作用,值则表示与索引相关的数据.set中每个元素只包含一个关键字,可以完成高效的 ...

  10. Linux1.0源代码编译过程

    根据源代码包中的readme文件及http://chfj007.blog.163.com/blog/static/173145044201191195856806/?suggestedreading& ...