xls

R 读取xls/xlsx文件

為{幸葍}努か 提交于 2019-12-01 12:59:17
readxl 包 install.packages('readxl',repois='https://mirrors.utsc.edu.cn/CRAN/) library(readxl) # read_excel()自动识别xls/xlsx # read_xls()读取xls # read_xlsx()读取xlsx data <- read_xlsx("d:/data/ch01.xlsx",na="NA") xlsx 包 依赖 rJava ,需要JAVA环境(JDK或JRE) install.packages('xlsx',repois='https://mirrors.utsc.edu.cn/CRAN/) library(xlsx) #一般会报错 加载 xlsx 报错信息 弹出"无法启动此程序,因为计算机中丢失 jvm.dll。尝试重新安装该程序以解决此问题。" 本计算机中已经安装了JRE1.8.0_131(32位),jvm.dll位于"client"文件夹中,将其路径添加到系统路径中:我的计算机-右键-高级系统设置-环境变量,编辑“系统变量”中的Path,在前面加入"C:\Program Files (x86)\Java\jre1.8.0_131\bin\client;"。确定。 有人建议,在R文件前加入 Sys.setenv(JAVA_HOME='C:/Program

how to sort xls file column wise and write it to another file with entire row using python?

亡梦爱人 提交于 2019-12-01 11:55:20
问题 how to sort xls file column wise and write it to another file with entire row using python ? the xls file has to be sorted column wise. And after sorting it has to be writen into another file. 回答1: How about: column = 0 #The column you want to sort by reader = list(csv.reader(open('input.xsl'))) reader.sort(key=lambda x: x[column]) writer = csv.writer(open('output.xsl', 'w')) writer.writerows(reader) My bad, well you can always export as csv i guess. If you want to stick to xls you can use

In python removing rows from a excel file using xlrd, xlwt, and xlutils

狂风中的少年 提交于 2019-12-01 10:55:14
Hello everyone and thank you in advance. I have a python script where I am opening a template excel file, adding data (while preserving the style) and saving again. I would like to be able to remove rows that I did not edit before saving out the new xls file. My template xls file has a footer so I want to delete the extra rows before the footer. Here is how I am loading the xls template: self.inBook = xlrd.open_workbook(file_path, formatting_info=True) self.outBook = xlutils.copy.copy(self.inBook) self.outBookCopy = xlutils.copy.copy(self.inBook) I then write the info to outBook while grabbing

In python removing rows from a excel file using xlrd, xlwt, and xlutils

只愿长相守 提交于 2019-12-01 09:03:25
问题 Hello everyone and thank you in advance. I have a python script where I am opening a template excel file, adding data (while preserving the style) and saving again. I would like to be able to remove rows that I did not edit before saving out the new xls file. My template xls file has a footer so I want to delete the extra rows before the footer. Here is how I am loading the xls template: self.inBook = xlrd.open_workbook(file_path, formatting_info=True) self.outBook = xlutils.copy.copy(self

Unable to use pyexcel-xls with pyinstaller . python executable not working . python version 3.4.4

孤街醉人 提交于 2019-12-01 08:41:29
The program works when run using: Python filename.py but when I create its executable file using " pyinstaller " pyinstaller -F filename.py the executable is successfully created, but execution of the script fails and following error is thrown. Traceback (most recent call last): File "site-packages\pyexcel_io\manager.py", line 160, in create_reader File "site-packages\pyexcel_io\manager.py", line 222, in _get_a_handler pyexcel_io.manager.NoSupportingPluginFound: No suitable library found for xls During handling of the above exception, another exception occurred: Traceback (most recent call

How can I merge two Excel (xls) files in Perl or batch?

£可爱£侵袭症+ 提交于 2019-12-01 07:41:04
问题 I have two files lets say a.xls and b.xls . The first one contains 2 sheets and the second one 3 of them. Can someone let me know if I can merge them using Perl or batch scripting? I want an output with 5 sheets in one single XLS file. 回答1: For a Perl solution use Spreadsheet::ParseExcel to read the files and Spreadsheet::WriteExcel to save your output. Both modules are well documented and come with lots of example code(e.g. WriteExcel) 回答2: If you are running on Windows, have Excel installed

Unable to use pyexcel-xls with pyinstaller . python executable not working . python version 3.4.4

瘦欲@ 提交于 2019-12-01 06:37:51
问题 The program works when run using: Python filename.py but when I create its executable file using "pyinstaller" pyinstaller -F filename.py the executable is successfully created, but execution of the script fails and following error is thrown. Traceback (most recent call last): File "site-packages\pyexcel_io\manager.py", line 160, in create_reader File "site-packages\pyexcel_io\manager.py", line 222, in _get_a_handler pyexcel_io.manager.NoSupportingPluginFound: No suitable library found for

PHPExcel return a corrupted binary file

不羁的心 提交于 2019-12-01 05:53:13
I want to write a reference xls file and retrieve the result. When I tested with a single file, it works but when the reference file is complex, this returns me a corrupt file with with kinds of data: Which is at the beginning like this: My php file is: error_reporting(E_ALL); ini_set('display_errors', TRUE); ini_set('display_startup_errors', TRUE); date_default_timezone_set('Europe/London'); if (PHP_SAPI == 'cli') die('This example should only be run from a Web Browser'); /** Include PHPExcel */ require_once '../phpexcel/Classes/PHPExcel.php'; $objPHPexcel = PHPExcel_IOFactory::load('..

Angular JS - How to export Javascript Object to XLS file ?

百般思念 提交于 2019-12-01 04:45:48
Actually, I've an object in my controller, i just want to export that object as .xls or .csv file.i used a lot of approaches like this: HTML <script src="https://rawgithub.com/eligrey/FileSaver.js/master/FileSaver.js" type="text/javascript" /> <div ng-controller="myCtrl"> <button ng-click="exportData()">Export</button> <br /> <div id="exportable"> <table width="100%"> <thead> <tr> <th>Name</th> <th>Email</th> <th>DoB</th> </tr> </thead> <tbody> <tr ng-repeat="item in items"> <td>{{item.name}}</td> <td>{{item.email}}</td> <td>{{item.dob | date:'MM/dd/yy'}}</td> </tr> </tbody> </table> </div> <

PHPExcel return a corrupted binary file

╄→гoц情女王★ 提交于 2019-12-01 04:42:54
问题 I want to write a reference xls file and retrieve the result. When I tested with a single file, it works but when the reference file is complex, this returns me a corrupt file with with kinds of data: Which is at the beginning like this: My php file is: error_reporting(E_ALL); ini_set('display_errors', TRUE); ini_set('display_startup_errors', TRUE); date_default_timezone_set('Europe/London'); if (PHP_SAPI == 'cli') die('This example should only be run from a Web Browser'); /** Include