XLSX

R - Importing xlsx file with date column

我的梦境 提交于 2019-12-08 11:44:28
问题 When I try to read in an excel file it always messes with the date/time. library(openxlsx) download.file("http://ec.europa.eu/economy_finance/db_indicators/surveys/documents/series/nace2_ecfin_1801/services_subsectors_sa_nace2.zip", destfile="services_subsectors_sa_nace2.zip") unzip("services_subsectors_sa_nace2.zip") bcs<-read.xlsx("services_subsectors_sa_m_nace2.xlsx", colNames=TRUE, sheet="73") Column 1 (no name given in the original dataset) would be the date/time column. By default this

Apache POI和excel操作

一世执手 提交于 2019-12-08 11:26:25
<!--添加依赖--> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.14</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>3.14</version> </dependency> 描述 POI结构: HSSF - 提供读写Microsoft Excel XLS格式档案的功能 XSSF - 提供读写Microsoft Excel OOXML XLSX格式档案的功能 HWPF - 提供读写Microsoft Word DOC格式档案的功能 HSLF - 提供读写Microsoft PowerPoint格式档案的功能 HDGF - 提供读Microsoft Visio格式档案的功能 HPBF - 提供读Microsoft Publisher格式档案的功能 HSMF - 提供读Microsoft Outlook格式档案的功能 测试类 package com.study.test; import org.apache.poi.ss.usermodel.Cell; import org

Unreadable content message with Jasper and .xlsx

做~自己de王妃 提交于 2019-12-08 08:48:24
问题 I have the following code that exports a xlsx to a stream. It works and I get the xlsx file but it says excel found unreadable content in "..." and asks if I want to recover the contents of the workbook. When I do so, I get the xlsx file with the correct data, in the correct places, as I wanted. How can I avoid or supress this error? try { ServletOutputStream servletOutputStream = resp.getOutputStream(); JasperReport jasperReport = JasperCompileManager .compileReport(path + "Template

install xlsx and xlsxjars in R 3.2.0

不想你离开。 提交于 2019-12-08 07:28:49
问题 Since today I am using the R Version 3.2.0 for statistical analysis. Today I try to install the packages "xlsx" and "xlsxjars" for my new installation but it didn't work. Every time I try to install the packages ( install.packages("xlsx") ) I get the following error message: Warning in install.packages : downloaded length 9351168 != reported length 9485172 trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/xlsx_0.5.7.zip' Content type 'application/zip' length 400857 bytes (391 KB)

Slow XSSFWorkbook and WorkbookFactory when reading xlsx files

若如初见. 提交于 2019-12-08 07:04:17
问题 I've seen developers have had this problem since a few years ago. I have studied many forums and the official POI documents. Nonetheless I haven't found an answer yet. So the problem is.. I have tried the following two snippets: Workbook wb = WorkbookFactory.create(new File("spreadsheet.xlsx")); and File file = new File("C:\\spreadsheet.xlsx"); OPCPackage opcPackage = OPCPackage.open(file.getAbsolutePath()); XSSFWorkbook workbook = new XSSFWorkbook(opcPackage); and either of the approaches

Trouble with openxlsx

女生的网名这么多〃 提交于 2019-12-08 06:46:15
问题 When I attempt to load an xlsx file with the loadWorkbook function I receive an error message. I am loading the workbook file from my local working directory and receive the following error message: Error in grepl(target, commentsXML) : invalid 'pattern' argument when I execute the basic function: loadWorkbook("template.xlsx") -> wb 回答1: To me it looks as if it's a bug. If you look at the source on github it has the following line: hasComment <- sapply(drawXMLrelationship, length) > 0 ##

AngularJS ui-grid import XLSX data best approach

非 Y 不嫁゛ 提交于 2019-12-08 06:44:39
问题 What would be the best approach to import XLSX data to be displayed using an AngularJS ui-grid? Is the js-xlsx parser a good choice for this, or are there other open source XLSX parser tools better suited for this task? In my case the XLSX data is very basic, nothing complicated, but I would like to preserve the style info as much as possible. I anticipate the the data grid will be less than 20 col x 1000 rows. Or would it be better to use an alternative data grid, such as the Hansontable,

Angular 6 - Formatting Export Excel Sheet

牧云@^-^@ 提交于 2019-12-08 05:46:11
问题 i would like to apply styling in excel sheet to represent the data. Here is my code import { Injectable } from '@angular/core'; import * as FileSaver from 'file-saver'; import * as XLSX from 'xlsx'; const EXCEL_TYPE = 'application/vnd.openxmlformats- officedocument.spreadsheetml.sheet;charset=UTF-8'; const EXCEL_EXTENSION = '.xlsx'; @Injectable() export class ExcelService { constructor() { } public exportAsExcelFile(json: any[], excelFileName: string): void { var aoa = this.create2DArray(json

How to download multiple files using loop in R?

蹲街弑〆低调 提交于 2019-12-08 04:50:56
问题 I have to download multiple xlsx files about a country's census data from internet using R. Files are located in this Link .The problems are: I am unable to write a loop which will let me go back and forth to download File being download has some weird name not districts name. So how can I change it to districts name dynamically. I have used the below mentioned codes: url<-"http://www.censusindia.gov.in/2011census/HLO/HL_PCA/HH_PCA1/HLPCA-28532-2011_H14_census.xlsx" download.file(url, "HLPCA

How to find out what makes poi corrupt a xlsx / xlsm file

末鹿安然 提交于 2019-12-08 04:10:26
I have the issue that Apache POI "corrupted" a xlsm / xlsx file by just reading and writing it (e.g. with the following code) public class Snippet { public static void main(String[] args) throws Exception { String str1 = "c:/tmp/spreadsheet.xlsm"; String str2 = "c:/tmp/spreadsheet_poi.xlsm"; // open file XSSFWorkbook wb = new XSSFWorkbook(new FileInputStream(new File(str1))); // save file FileOutputStream out = new FileOutputStream(str2); wb.write(out); wb.close(); out.close(); } } Once you open the spreadsheet_poi.xlsm in Excel you'll get an error like the following "We found a problem with