XLSX

Cannot install library(xlsx) in R and look for an alternative

筅森魡賤 提交于 2019-11-28 12:43:37
I use R version 3.0.3. I was not able to install library(xlsx). Error message: Loading required package: rJava Error : .onLoad failed in loadNamespace() for 'rJava', details: call: inDL(x, as.logical(local), as.logical(now), ...) error: unable to load shared object 'C:/Program Files/R/R-3.0.3/library/rJava/libs/x64/rJava.dll': LoadLibrary failure: The specified module could not be found. I then tried to install rjava on its own. Got the error message below: library("rJava", lib.loc="C:/Program Files/R/R-3.0.3/library") Error : .onLoad failed in loadNamespace() for 'rJava', details: call: inDL

OpenXML: Excel, extracting Cell text and Image/Picture data

时间秒杀一切 提交于 2019-11-28 10:28:30
I am writing code to extract the cells and pictures/images in cells from an Excel doc into a database. With this code I can get the cell values that are not Pictures. However, the Cell object doesn't have a picture it in. Note that every row starts with an image. A1- Picture B1- Text C1- Text and so on. How do I get the image from the "A" column? WorkbookPart wbPart = document.WorkbookPart; var workSheet = wbPart.WorksheetParts.FirstOrDefault(); foreach (Row r in workSheet.Worksheet.Descendants<Row>()) { //Note only has Colum B,C. Not A as A has an image??? foreach(Cell c in r.ChildElements) {

Convert .csv to .xls in Java

匆匆过客 提交于 2019-11-28 08:36:20
Does anyone here know of any quick, clean way to convert csv files to xls or xlsx files in java? I have something to manage csv files already in place and I need the extra compatibility for other programs. Sample code in addition to package names is always well appreciated. Many thanks, Justian Here's my code thus far. I need to remove the returns ("\n") from the lines. Some of my cells contain multiple lines of information (a list), so I can use "\n" in csv to indicate multiple lines within a cell , but xls treats these as if I mean to put them on a new line . The code is modified from the

How to fix OutOfMemoryError (Java): GC overhead limit exceeded in r? [duplicate]

孤人 提交于 2019-11-28 08:25:10
This question already has an answer here: “Out of Memory Error (Java)” when using R and XLConnect package 7 answers I have to read a file in a list of folders and save data in R. I use following code for my test data and it works. When I use the code for the actual data then I get this error Error: OutOfMemoryError (Java): GC overhead limit exceeded Called from: top level This is what I have done for my test data parent.folder <- "C:/Users/sandesh/Desktop/test_R" sub.folder <- list.dirs(parent.folder, recursive =TRUE)[-1] file <- file.path(sub.folder, "sandesh1.xlsx") library(xlsx) library

Dynamically converting a list of Excel files to csv files in R

こ雲淡風輕ζ 提交于 2019-11-28 06:39:28
I currently have a folder containing all Excel (.xlsx) files, and using R I would like to automatically convert all of these files to CSV files using the "openxlsx" package (or some variation). I currently have the following code to convert one of the files and place it in the same folder: convert("team_order\\team_1.xlsx", "team_order\\team_1.csv") I would like to automate the process so it does it to all the files in the folder, and also removes the current xlsx files, so only the csv files remain. Thanks! You can try this using rio, since it seems like that's what you're already using:

openxlsx not able to read from .xlsx file in R

会有一股神秘感。 提交于 2019-11-28 05:07:57
问题 I am trying to read value from a .xlsx file using openxlsx package in R . In simple words, I need to write a row of data, which then populates some output cell that has to be read back in R. I will share an example to better explain the problem. Initial state of the .xlsx file: I'm now trying to write new values to the cell : A2:A3 = c("c", 5). So ideally, I'm expecting A6 = 15 Below is the code used : require(openxlsx) path <- "C:/path_to_file/for_SO1.xlsx" input_row <- c("c", 5) # Load

How to read data from xlsx in perl

守給你的承諾、 提交于 2019-11-28 04:37:07
问题 Need a few good people help me with reading excel file with extension "xlsx" my script works for "xls" but not "xlsx", here is the code I get error: Can't call method "worksheet" on an undefined value if the file is "xlsx" here is the code I do have: #!/usr/bin/perl -w use warnings; use strict; use Spreadsheet::ParseExcel; use Spreadsheet::XLSX; use Date::Format; my $filename = "../test.xlsx"; #Parse excel file my $parser = Spreadsheet::ParseExcel->new(); my $workbook = $parser->parse("

Parse XLSX with Node and create json

可紊 提交于 2019-11-28 03:02:18
Ok so I found this really well documented node_module called js-xlsx Question: How can I parse an xlsx to output json ? Here is what the excel sheet looks like: In the end the json should look like this: [ { "id": 1, "Headline": "Team: Sally Pearson", "Location": "Austrailia", "BodyText": "...", "Media: "..." }, { "id": 2, "Headline": "Team: Rebeca Andrade", "Location": "Brazil", "BodyText": "...", "Media: "..." } ] index.js: if(typeof require !== 'undefined') { console.log('hey'); XLSX = require('xlsx'); } var workbook = XLSX.readFile('./assets/visa.xlsx'); var sheet_name_list = workbook

returning decimal instead of string (POI jar)

孤者浪人 提交于 2019-11-28 02:18:51
I need to read xls or xlsx sheet. successfully I read the sheet, but it returning decimal value instead of string (eg: for 3 -- it is returning 3.0). I need to read the cell values as it is. so I need to return as string POI is giving you the exact value that Excel has stored in the File. Generally, if you write a number in an Excel cell, Excel will store that as a number with formatting. POI provides support to do that formatting for you if you want it (most people don't - they want the numbers as numbers so they can use them) The class you're looking for is DataFormatter . Your code would be

How to Bulk Insert from XLSX file extension?

旧巷老猫 提交于 2019-11-28 02:00:49
Can anyone advise how to bulk insert from .xlsx file? I tried the below query already: BULK INSERT #EVB FROM 'C:\Users\summer\Desktop\Sample\premise.xlsx' WITH (FIELDTERMINATOR = '\t', ROWTERMINATOR = '\n', FIRSTROW = 2); SELECT * FROM #EVB I also tried with FIELDTERMINATOR like "**\t**", "**,**", "**;**", "**|**" , but this doesn't work either. Unfortunately, there is no error message. you can save the xlsx file as a tab-delimited text file and do BULK INSERT TableName FROM 'C:\SomeDirectory\my table.txt' WITH ( FIELDTERMINATOR = '\t', ROWTERMINATOR = '\n' ) GO Turque You need to use