FAQ Database Discussion Community


Apache POI XSSFFont getBold() give null pointer exception

java,apache,apache-poi,xlsx,xssf
I'm trying to check whether the font in excel is bold or not.I kept getting a null pointer exception everytime I run the code. XSSFSheet sheet1 = workbook.getSheetAt(1); XSSFRow row1 = sheet1.getRow(1); XSSFCell cell4 = row1.getCell(4); XSSFRichTextString val = cell4.getRichStringCellValue(); System.out.println(val.toString()); XSSFFont f = val.getFontAtIndex(0); System.out.println(f.getBold()); <--- this line is...

importdata to large matrix

performance,matlab,import,xlsx
I have xlsx file which contains 750,000x33 cells. when i tried to: [FileName PathName] = uigetfile('*.xlsx','XLSX Files'); fid = fopen(FileName); T=importdata(FileName); I waited for 1 hour and it didnt finish yet. Is there anything i can do to speed the process? Tried to use xlsread but it didnt work aswell....

Pandas: Always selecting the first sheet/tab in an Excel Sheet

python,excel,python-3.x,pandas,xlsx
I know how to get the list of sheet names. The excel file I am using has multiple sheets. How do I select the first one sequentially ? I don't know the name of the sheet but I need to select the first one. How would I go about this...

Openpyxl - trouble naming workbook

python,xlsx,openpyxl
I have a python script that analyses a file tree and records its findings in an xlsx. Analysis is going fine, but when I try to record my results, I get an error: Traceback (most recent call last): File ".\call_validation.py", line 103, in <module> wb.save(wb_name) File "C:\Python\lib\site-packages\openpyxl\workbook\workbook.py", line 298, i...

Sorting XLSX data and writing to CSV

python,excel,sorting,csv,xlsx
I am trying to take a large data file and sort it. In the end I want something like this: Customer, Machine Error, User Error Customer 1 with most calls, #of calls, #of calls Customer 2 with next amount calls, #of calls, #of calls Where I sort the top twenty...

NoClassDefFoundError: UnsupportedFileFormatException while working with excel sheet using java

java,excel,apache-poi,xlsx,xssf
I'm writing a Java program which reads from a .xlsx file and give the output in .csv format. This is my code: import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.Writer; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Iterator; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.ss.usermodel.Cell;...

Stuck on import wizard SQL Server 2008 R2 (from Excel)

sql,excel,import,sql-server-2008-r2,xlsx
I'm trying to import data from my excel file to a SQL Server database. Everything goes fine until the last steps. It is stuck there forever. I left it running all night and in the morning was still running on these steps. The Excel file has 100 rows (not much)....

Delphi System.Zip xlsx LibreOffice

excel,delphi,zip,xlsx,libreoffice
My system is WIN7 64 and I use a Delphi XE7 component to create .xlsx files. An example result file. The files can be opened with MS Office (no problem), but with LibreOffice I can't because I have this error: "The file is corrupted and can't be openend ...". Suspicion...

Excel & EPPlus .NET library: Advanced DropDown list validation

excel,xlsx,epplus-4
In Epplus, when we create a DropDown list for some cells in excel file, then user put a value which is not part of the list, the cell show a message says: value must match one of the listed items. Instead of this message, Is it possible to prevent the...

Open xls and xlsx with Apache POI

java,excel,apache-poi,xls,xlsx
I want to open my excel file with Apache POI. I don’t know if a file is xls or xlsx. I have only something like this: InputStream myExcelFile = new ByteArrayInputStream(file.getData()); This way I can open xls file: HSSFWorkbook hsf = new HSSFWorkbook(myxls); And this way I can open xlsx...

Import .xlsx file with PHP

php,excel,xlsx
Here my snippet code require_once 'readernew.php'; $data = new Spreadsheet_Excel_Reader(); $data->setOutputEncoding('CP1251'); $data->read('InOut.xlsx'); $res = $data->sheets; var_dump($data); but it give the error like filename is not readable without the password protection will you please help to access .xlsx file...

How to get header and data from Models in Python?

python,django,model,xlsx,openpyxl
Following this example (for openpyxl): from openpyxl.workbook import Workbook header = [u'Name', u'Email', u'Mobile', u'Current location',] new_data = [[u'name1', u'[email protected]', 9929283421.0, u'xxxx'], [u'name2', u'[email protected]', 9994191988.0, u'xxxx']] wb = Workbook() dest_filename = 'empty_book.xlsx' ws1 = wb.active ws1.title = "range names" ws1.append(header) for row in new_data: ws1.append(row) wb.save(filename = dest_filename) I have...

“read_excel” in a Shiny app

r,shiny,xlsx
I have a Shiny app that uses the "read.xlsx" function from package "xlsx". All works fine, but I want to change to "read_excel" from "readxl", hoping it would be faster and able to cope with large files. ui part: fileInput("inputFile","Upload file...") server part: data <- reactive({ inFile <- input$inputFile if...

Running script for every string result in range

excel-vba,xlsx
I'm new to Excel and VBA, so please bear with me. I've got a macro that: Get string from G1. Search F column for match. If match is found, copy row and paste it to the bottom of data in sheet with same name as string from G1. But then...

Reading a string column in xlsx with date and time values

r,datetime,xlsx,posixct,posixlt
I am reading a .xlsx file using R. One of the columns is called "Date" and it has the following format: "20/10/2014 12:00:00 am". However, when I read the file using R's xlsx package, the value becomes 41932-- class factor. How can I read the entire column as a string...

How to set custom header names with ALASQL and XLSX

angularjs,excel,xlsx,alasql
I'm exporting some tables to excel, using angular, alasql and xlsx. I'm using it as follows: var options = { headers: true, sheetid: 'users', columns: [{ columnid: 'a', title: 'Username' }, { columnid: 'b', title: 'First name' }, { columnid: 'c', title: 'Last name' }] }; alasql('SELECT * INTO XLSX("test.xlsx",...