XLSX

Is openpyxl the fastest package to use to read big xlsx files?

女生的网名这么多〃 提交于 2019-12-06 12:43:28
问题 I'm a python beginner but I'm writing a script using openpyxl to read in big xlsx files (60000x187) into Numpy arrays to do some machine learning. My code: from openpyxl import load_workbook import re from numpy import * wb = load_workbook(filename = 'dataSheet.xlsx', use_iterators = True) #dataSheet.xlsx ws1 = wb.get_sheet_by_name(name = 'LogFileData') startCol = 1 #index from 1 startRow = 2 #start at least from 2 because header is in 1st row endCol = ws1.get_highest_column() #index of last

How to insert a table in ms excel using apache java poi

六眼飞鱼酱① 提交于 2019-12-06 09:07:52
I am trying to insert a table in Excel using Java Apache Poi. But when I am opening the xlsx file it is throwing the following error and I could not solve it: Removed Part: /xl/tables/table1.xml part with XML error. (Table) Load error. Line 2 repaired records: table from /xl/tables/table1.xml part (table) My code is the following: import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFTable; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org

Edit XLSX in PHP

南笙酒味 提交于 2019-12-06 08:10:26
问题 Hi there is a way to edit uploaded Excel (xlsx) document in PHP. Document is very simple (table with item names, price, quantity). I suppose PHPExcel able only read document but not edit? Any advices? 回答1: You can use PHPExcel to edit a document as well, check out these threads for more information: Read - Edit - Write Excel File PHPExcel modify existing .xlsx file with multiple worksheet How to open an Excel file with PHPExcel for both reading and writing? 回答2: OpenTBS can edit XLSX

Element 表格导出Excel

空扰寡人 提交于 2019-12-06 08:04:39
一、安装xlsx和filesaver npm install --save xlsx file-saver 二、在表格组件中引入安装的2个文件 import FileSaver from "file-saver"; import XLSX from "xlsx"; 三、HTML结构 <el-table :data="tableData3" style="width: 500px" height="250" id="table"> <el-table-column fixed prop="date" label="日期" width="150"></el-table-column> <el-table-column prop="name" label="姓名" width="120"></el-table-column> <el-table-column prop="province" label="省份" width="120"></el-table-column> <el-table-column prop="city" label="市区" width="120"></el-table-column> <el-table-column prop="address" label="地址" width="300"></el-table-column> <el-table

Print/save Excel (.xlsx) sheet to PDF using R

ⅰ亾dé卋堺 提交于 2019-12-06 07:45:27
问题 I want to print an Excel file to a pdf file after manipulating it. For the manipulation I used the .xlsx package which works fine. There is a function printSetup but I cannot find a function to start the printing. Is there a solution for this? library(xlsx) file <- "test.xlsx" wb <- loadWorkbook(file) sheets <- getSheets(wb) # get all sheets sheet <- sheets[[1]] # get first sheet # HERE: MAGIC TO SAVE THIS SHEET TO PDF It may be a solution using DCOM through the RDCOMClient package, though I

Error reading timestamps using “xlsx” package

你说的曾经没有我的故事 提交于 2019-12-06 07:24:54
Data in Excel file looks like TIMESTAMP TYPE BID BIDSIZ 2015-01-04 09:00:00 BID 365 10 2015-04-01 09:00:05 BID 367.8 55 2015-04-01 09:00:33 BID 365 10 2015-04-01 09:00:36 BID 367.8 55 When I run the following code: require(xlsx) f1<-read.xlsx2("Canara_Data.xlsx", sheetName = "BID") f1$TIMESTAMP<-as.POSIXct(f1$TIMESTAMP, format="%Y-%M-%D %H:%M:S") viewing it causes TIMESTAMP to look like View(`f1`) TIMESTAMP X. BID BIDSIZ 42008.375 BID 365 10 42095.37505787037 BID 367.8 55 42095.37538194445 BID 365 10 42095.37541666667 BID 367.8 55 str(f1) # 'data.frame': 18214 obs. of 4 variables: # $

Checking for empty cells with OpenPyXl

旧城冷巷雨未停 提交于 2019-12-06 07:19:36
I've poured over numerous versions of this same question, but simply cannot find a working solution for looping through a group of cells and checking for empty ones. Here's my code: wb = openpyxl.Workbook(write_only=False) sheet = wb.get_sheet_by_name('Sheet') for i in range(1, 20): if sheet.cell(row=i, column=1).value == None or 'None': print('Space' + str(i)) sheet.cell(row=i, column=1) = i else: pass wb.save('filename.xlsx') But for some reason it writes to the empty cells AND overwrites the cells which had values written in them. I comment out the loop I find that if I run the code it

Password protected xls/xlsx file in java

僤鯓⒐⒋嵵緔 提交于 2019-12-06 07:18:08
I have created password protected zip file which has xls file with the help of this http://java.sys-con.com/node/1258827 . My question is ,Is there any java api which will create password protected xls file instead of zip file. I want to directly apply password on xls file.Encryption/Decryption is the option but want to prompt when when double clicked on file. edit: I got this HSSFSheet.protectSheet("xyz"); but it only makes sheet read only. Even I have tried this hssfworkbook.writeProtectWorkbook("abc", "abc"); but its not prompting for password. Edit1:There is the method in org.apache.poi

Apache POI xlsx read, cell with # value - error unexpected cell type(5)

二次信任 提交于 2019-12-06 07:08:08
问题 Could you hepl me with such issue. I need to read each cell as String value. In this case I am using appache poi lib. and such method for normilizing each cell: String getNormilizedCell(Cell cell){ return new DataFormatter().formatCellValue(cell);} But when In .xlsx file I faced with such value: |#N/A|#N/A|...|...|... I am getting error [Unexpected Cell type (5)] and I don't know how to handle this. In google I can't find necessary information. 回答1: The DataFormatter class only handles CELL

reading excel file --> xlsx format with java

◇◆丶佛笑我妖孽 提交于 2019-12-06 06:57:45
I'm trying to read an excel file (xlsx NOT xls) but without any luck. I tried the jexcel api but it doesn't support xlsx extension, then I tried the Apache api which need to work and tried also the example from their web site but with no luck.I can't pass the read file phase and get a filenotfound exception. also used the poi-ooxml-3.6.jar,xmlbeans-2.6.0 and poi-3.7.jar. can anyone please explain to me what types of api/classes/libraries I need to use and how to use it with eclipse (the external libraries/classes/api is totally new to me) many thanks in advance Benoit Wickramarachi Apache POI