xls

使用PHP导入Excel和导出数据为Excel文件

﹥>﹥吖頭↗ 提交于 2019-11-29 01:01:53
有时需要将Excel表格的数据导入到mysql数据库中,我们使用PHP的一个开源项目PHP-ExcelReader可以轻松实现Excel的导入。另外将mysql数据导出为Excel与本站上篇文章中导出CSV一样,只是将逗号分割符换成制表符,并修改header信息就可以了。 下载源码 本文中,我们沿用本站文章: 使用PHP导入和导出CSV文件 中实例的数据表以及html。 1、导入XLS PHP-ExcelReader这是一个开源的项目,主要是来解析excel的文件,您可以到 http://sourceforge.net/projects/phpexcelreader 获取最新版的源码。下载之后解压,主要用到excel文件夹里面的两个文件reader.php和oleread.inc。 导入Xls处理流程:选择xls文件->上传xls文件到服务器->通过PHP-ExcelReader解析excel->批量入库。 include_once("excel/reader.php"); //引入PHP-ExcelReader $tmp = $_FILES['file']['tmp_name']; if (empty ($tmp)) { echo '请选择要导入的Excel文件!'; exit; } $save_path = "xls/"; $file_name = $save_path

Read local xls/xlsx file in javascript

微笑、不失礼 提交于 2019-11-29 00:09:25
Can we read large local xls/xlsx file in angularjs/Javascript without using any liabrary, if not then which is most suitable library? Reena While looking for this I found this: Basic parsers implemented in pure JS: http://oss.sheetjs.com/js-xls/ (XLS files, what you wanted) http://oss.sheetjs.com/js-xlsx/ (XLSX/XLSM/XLSB files) I'm providing the reference How to parse Excel file in Javascript/HTML5 https://gist.github.com/psjinx/8002786 Hope this could be helpful. use this code to read <script> /* set up XMLHttpRequest */ var url = "test.xlsx"; var oReq = new XMLHttpRequest(); oReq.open("GET",

Delphi - cxGrid内容xlsx/.xls /.csv格式导出

岁酱吖の 提交于 2019-11-28 19:27:42
.xls格式导出,uses中添加cxGridExportLink 代码如下: 1 function SaveToExcel(gridMain: TcxGrid; FileName: string): string; 2 var 3 SaveFileDialog: TSaveDialog; 4 begin 5 //示例:SaveToExcel(dxDBGrid1,'默认文件名'); 6 SaveFileDialog := TSaveDialog.Create(nil); 7 SaveFileDialog.FileName := FileName; 8 SaveFileDialog.Filter := '*.xls'; 9 if SaveFileDialog.Execute then 10 begin 11 if pos('.XLS', UpperCase(SaveFileDialog.FileName)) <= 0 then 12 SaveFileDialog.FileName := SaveFileDialog.FileName + '.XLS'; 13 ExportGridToExcel(SaveFileDialog.FileName, gridMain); 14 ShowMessage('数据已成功导出到您指定的目录中'); 15 end; 16 Result :=

Dates from Excel to R, platform dependency

人走茶凉 提交于 2019-11-28 19:19:11
问题 I'm importing xls files using gdata . I am converting date columns using as.Date to convert the date As per the manual for as.Date , the date origin is platform dependent, and so I am determining which origin to use accordingly .origin <- ifelse(Sys.info()[['sysname']] == "Windows", "1899-12-30", "1904-01-01") as.Date(myData$Date, origin=.origin) However, I'm wondering if I should be considering the platform where the file is being read or the platform where it was written ? For what it's

Is there a coalesce-like function in Excel?

故事扮演 提交于 2019-11-28 19:07:13
I need to fill a cell with the first non-empty entry in a set of columns (from left to right) in the same row - similar to coalesce() in SQL. In the following example sheet --------------------------------------- | | A | B | C | D | --------------------------------------- | 1 | | x | y | z | --------------------------------------- | 2 | | | y | | --------------------------------------- | 3 | | | | z | --------------------------------------- I want to put a cell function in each cell of row A such that I will get: --------------------------------------- | | A | B | C | D | ---------------------

Exporting HTML tables to Excel (.xls) in a separate sheet

 ̄綄美尐妖づ 提交于 2019-11-28 18:55:19
I've got a simple HTML page (generated by an external application) that contains a table view. I am trying to scrape off the tables from the page and put them in an Excel workbook. I have managed to put the whole HTML contents in a workbook by using the method available here . Code from the related question: var tableToExcel = (function() { var uri = 'data:application/vnd.ms-excel;base64,' , template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook>

Matlab xlsread cutting off file after row 1048576

血红的双手。 提交于 2019-11-28 14:25:42
Is there any other way of importing an Excel formatted .csv into Matlab other than xlsread(file.csv); The file I have contains 2830082 lines, and xlsread seems to have a limit of 1048576 lines when reading it - the rest gets cut off. The file looks like: Time, Value 12:07:29, -1.13 12:07:29, -7.54 ... So using csvread(..) isn't going to work because of the date format. I've found the fastest way to read BIG csv files into Matlab is to memory-map them and parse the contents as a single string. Try playing with this example code: fname = 'file.csv'; fstats = dir(fname); % Map the file as one

Issues converting csv to xls in Java? Only core Java experience needed - question not related to import

扶醉桌前 提交于 2019-11-28 13:37:35
问题 First of all, I understand that it's unusual that I want to up-convert like this, but please bear with me. We get these csv files via website export and we have no options to get it in any other form. Now, onto the question: I have this old code that will do this process for me. It basically reads each line, then picks out each value between the , s. This worked great for some samples that I converted, but when it came down to working with the samples given, some values were out of place. I

How can I include svg / png / vml images directly in an xls sheet?

一笑奈何 提交于 2019-11-28 12:48:46
I want to include (if I even can) include directly an svg image into an xls sheet that is written in xml like <Worksheet><Row><Cell></Cell></Row></Worksheet> I want to embed them directly but I don't know how I can do this in xml and what works in excel 2003. Or doesnt it even work with ms excel? I need to show an svg image directly in an excel sheet. 来源: https://stackoverflow.com/questions/7447254/how-can-i-include-svg-png-vml-images-directly-in-an-xls-sheet

Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE))

孤者浪人 提交于 2019-11-28 10:41:28
I am trying to convert a .xls file to an .xlsx file on the server-side using Microsoft.Office.Interop.Excel.Workbook class as follows: workBook.SaveAs("FILENAME_HERE", XlFileFormat.xlOpenXMLWorkbook, Type.Missing, Type.Missing, Type.Missing, Type.Missing, XlSaveAsAccessMode.xlNoChange, Microsoft.Office.Interop.Excel.XlSaveConflictResolution.xlLocalSessionChanges, Type.Missing, Type.Missing, Type.Missing, Type.Missing); and I get the following error: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80080005