xls

java读写excel之POI篇—001

为君一笑 提交于 2019-12-05 10:38:30
POI 简单介绍 Apache POI是 Apache软件基金会 的开放源码函式库,POI提供API给Java程序对Microsoft Office格式档案读和写的功能。 Apache POI 是创建和维护操作各种符合Office Open XML(OOXML)标准和微软的OLE 2复合文档格式(OLE2)的Java API。用它可以使用Java读取和创建,修改MS Excel文件.而且,还可以使用Java读取和创建MS Word和MSPowerPoint文件。Apache POI 提供Java操作Excel解决方案。 如果处理.xlsx、docx、pptx的话可以试试Docx4j 。 Docx4j is a Java library for creating and manipulating Microsoft Open XML (Word docx, Powerpoint pptx, and Excel xlsx) files. 基本功能 HSSF - 提供读写Microsoft Excel XLS格式档案的功能。 XSSF - 提供读写Microsoft Excel OOXML XLSX格式档案的功能。 HWPF - 提供读写Microsoft Word DOC格式档案的功能。 HSLF - 提供读写Microsoft PowerPoint格式档案的功能。 HDGF -

convert a tsv file to xls/xlsx using python

余生长醉 提交于 2019-12-05 10:25:00
I want to convert a file in tsv format to xls/xlsx.. I tried using os.rename("sample.tsv","sample.xlsx") But the file getting converted is corrupted. Is there any other method of doing it? Here is a simple example of converting TSV to XLSX using XlsxWriter and the core csv module: import csv from xlsxwriter.workbook import Workbook # Add some command-line logic to read the file names. tsv_file = 'sample.tsv' xlsx_file = 'sample.xlsx' # Create an XlsxWriter workbook object and add a worksheet. workbook = Workbook(xlsx_file) worksheet = workbook.add_worksheet() # Create a TSV file reader. tsv

Python - Validate if a sheet exists in my document xls

被刻印的时光 ゝ 提交于 2019-12-05 10:13:40
I am trying to design a small program on my free time which loads an xls file, then select a sheet in the document to be scanned. Step 1: the user imports an .xls file . After importing the program checks whether the file exists. (That I can do ) Step 2: I ask the user to give the name of the document sheet xls to analyze. And that 's where it stops. the program does not detect the sheets available :( #check if the document exist while True: x = input("Give the name of the document in this repository__") input_filename = x + ".xls" if os.path.isfile(input_filename): print ("the document is

Making new colors in JExcelApi

房东的猫 提交于 2019-12-05 03:22:32
I'm using JExcelApi for generating XLS files. From jxl.format.Colour , I see how to get any of the colors in the "standard Excel colour palette", but not how to create a new color (say, given its RGB). But in Excel itself, I can pick any color at all. Am I just missing it? Is there a way in JExcelApi to select an arbitrary color? I'm using a simple find-the-closest-standard-color method right now, which is OK but not great. Excel versions before 2007 have a standard palette, and given that the API you are using does not support the 2007 format, you may be stuck with that. The reason you can

Safari adding .html to download

青春壹個敷衍的年華 提交于 2019-12-05 01:28:48
I have a little function, that creates .xls document(using PHPexcel) and then sends it to php://output. Then user download it. Everything works fine, except that safari on mac os x adds .html extension for some reason. So the resulted file is named report.xls.html. Content is ok, but it is annoying to the users. How can I resolve this? Here is part of my code: $filename = 'report.xls'; header('Content-Description: File Transfer'); header('Content-Type: application/vnd.ms-excel'); header('Content-Disposition: attachment; filename="'.$filename.'"'); header('Content-Transfer-Encoding: binary');

can git be used for version control on non text documents such as word doc or xls etc

倾然丶 夕夏残阳落幕 提交于 2019-12-04 23:34:32
I've been learning about the GIT version control system recently and It seems to work very well for plain text documents as you can add a single line, go back and fork it, revise the document and remove the line you just added. I program mostly in excel and write documentation in word. Can GIT be used to manage versions of these files (obviously not the stuff inside the files, but the files themselves?) Git is agnostic in the sense that it doesn't matter which files you put under version control. When git can't recognise the type of a file it just treats it as binary data for versioning

Upload and insert xls file to mysql?

ぐ巨炮叔叔 提交于 2019-12-04 21:31:23
I´m strugeling to find a tutorial to show me how to code a php script that will let me upload and insert xls (not CSV) into mysql. I have this php script with fgetcsv and it works all fine. But i need to include support for xls. my PHP if(isset($_POST["Import"])){ echo $filename=$_FILES["file"]["tmp_name"]; if($_FILES["file"]["size"] > 0) { $file = fopen($filename, "r"); while (($emapData = fgetcsv($file, 10000, ",")) !== FALSE) { //It wiil insert a row to our subject table from our csv file` $sql = "INSERT into excell_import (`objekt`, `element_nummer`, `element_hojd`, `element_langd`,COURSE

Writing heirarchical JSON data to Excel xls from Python?

大兔子大兔子 提交于 2019-12-04 20:56:27
I want to write some data from python to xlsx. I currently have it stored as JSON, but it doesn't matter what it is going out of Python. Here's what the JSON for a single article would look like: { 'Word Count': 50 'Key Words': { ['Blah blah blah', 'Foo', ... ] } 'Frequency': { [9, 12, ... ] } 'Proper Nouns': { ['UN', 'USA', ... ] } 'Location': 'Mordor' } I checked out the XlsxWriter module but can't figure out how to translate hierarchical data that is not necessarily the same size (note the number of proper nouns between the two data "objects"). What I want the data to look like: Any

How to create a new worksheet in Excel file c#?

巧了我就是萌 提交于 2019-12-04 18:39:01
问题 I need to create a very big Excel file, but excel file in one worksheet can contain up to 65k rows. So, i want to divide all my info into several worksheets dynamical. This is my approximate code //------------------Create Excel App-------------------- Excel.Application xlApp; Excel.Workbook xlWorkBook; Excel.Worksheet xlWorkSheet; object misValue = System.Reflection.Missing.Value; xlApp = new Excel.Application(); xlWorkBook = xlApp.Workbooks.Add(misValue); xlWorkSheet = (Excel.Worksheet

Export data to *.xls file by using xml to create the file on an iOS 5 App

自闭症网瘾萝莉.ら 提交于 2019-12-04 13:08:02
I'm using the following code, to create an *.xls file on my iOS App. Everything is going right. I can open it with Microsoft Excel but, if I would like to open it with Apple Numbers, it doesn't work. - (void)exportToExcel { NSManagedObjectContext *context = [self managedObjectContext]; NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSError *error; NSString *header = @"<?xml version=\"1.0\"?>\n<Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\"\nxmlns:o=\"urn:schemas-microsoft-com:office:office\"\nxmlns:x=\"urn:schemas-microsoft-com:office:excel\"\nxmlns:ss=\"urn:schemas