xls

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

Working with XML & XSL

余生长醉 提交于 2019-12-06 06:59:51
问题 FIRST EDIT I'm fetching the Child 1 tag into a DropDownList in a C# form, Plz suggest the best practise code (C#) for deleting the Parent tag & all it's child tags in an XML file. Example: <Parents> <Parent> <Child 1>Something</Child 1> <Child 2>Something</Child 2> <Child 3>Something</Child 3> <Child 4>Something</Child 4> </Parent> <Parent> <Child 1>Something 1</Child 1> <Child 2>Something 1</Child 2> <Child 3>Something 1</Child 3> <Child 4>Something 1</Child 4> </Parent> </Parents> ---

Convert xls / xlsx files (all sheets) to csv using VBScript (delimited by semicolons)

℡╲_俬逩灬. 提交于 2019-12-06 05:01:31
I need to convert an excel file (*.xls , *.xlsx) including ALL worksheets inside into a CSV file split per sheet. The output CSV file(s) should be named by SheetName(s) and delimited by semi-colons, instead of commas. I have done this, by bonding several VBS scripts into one, but I still have there a bug. My code below does convertion for all sheets in XLS file delimited by semicolons,named by sheets - BUT a little bug is that if there is more than 1 worksheet, the contents of next sheets are overwritten by a first sheet. Whats wrong there please? Im running it in cmd with: xls_to_csv.vbs

convert a tsv file to xls/xlsx using python

非 Y 不嫁゛ 提交于 2019-12-06 04:39:25
问题 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? 回答1: 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

In which class should I load my data when using MVVM

匆匆过客 提交于 2019-12-06 04:29:08
问题 I'm currently learning C#, and recently I've learned about the MVVM design pattern for WPF. I am writing a simple program as a way to practice this, but I'm not sure where I should write the method that loads the data. I have a SalesSheet class, as shown below. This holds the data that I load from a .xls file. class SalesSheet { public List<Row> Rows { get; set; } public SalesSheet() { Rows = new List<Row>(); } public class Row { public string CallType { get; set; } public string HistoryText

python 读写excel(xls格式)

孤街浪徒 提交于 2019-12-06 04:26:53
import xlrd #导入模块 from xlutils.copy import copy #导入copy模块 rb = xlrd.open_workbook(r"e:\额度导入表.xls", formatting_info=True) #打开文件 wb = copy(rb) #利用xlutils.copy下的copy函数复制 ws = wb.get_sheet(0) #获取表单0 # ws.write(0, 0, 'changed!') #改变(0,0)的值 ws.write(8, 0,label = '好的') #增加(8,0)的值 wb.save(r"e:\额度导入表.xls") #保存文件 来源: https://www.cnblogs.com/feifeifeisir/p/11961766.html

OLEDBConnection.Open() generates 'Unspecified error'

廉价感情. 提交于 2019-12-06 03:05:05
I have an application that uploads an Excel .xls file to the file system, opens the file with an oledbconnection object using the .open() method on the object instance and then stores the data in a database. The upload and writing of the file to the file system works fine but I get an error when trying to open the file on our production server only . The application works fine on two other servers (development and testing servers). The following code generates an 'Unspecified Error' in the Exception.Message. Quote: System.Data.OleDb.OleDbConnection x = new System.Data.OleDb.OleDbConnection(@

How to check a column is hidden or not in excel file using apache poi

久未见 提交于 2019-12-05 17:55:32
I am trying to parse a xls file using apache poi. Is it possible to check whether a column is hidden or not. How can I get the width of a particular column. Example: According to the post here it checks if the row is hidden or not. Similarly I want to check the width of a column ( or check if the column is hidden or not) you can set a column as hidden/unhidden by using sheet.setColumnHidden(int columnIndex, boolean hidden); e.g. sheet.setColumnHidden(2, true); // this will hide the column index 2 sheet.setColumnHidden(2, false); // this will unhide the column index 2 and the column is hidden

python3读取、写入、追加写入excel文件

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 17:43:57
由于excel版本不同,python处理的时候选择的库页不同。 一、操作对应版本表格需要用到的库 1、操作xls格式的表格文件,需要用到的库如下: 读取:xlrd 写入:xlwt 修改(追加写入):xlutils 2、操作xlsx格式的表格文件,需要用到的库如下: 读取/写入:openpyxl (好像对于xlsx格式的表格,使用xlrd也是可以读取的,只是写入会有问题,不过避免问题还是根据不同格式的表格选择对应的库吧~) 二、实现代码 1、xlwt写入xls文件内容 import xlwt def write_excel_xls(path, sheet_name, value): index = len(value) # 获取需要写入数据的行数(value是个二维数组) workbook = xlwt.Workbook() # 新建一个工作簿 sheet = workbook.add_sheet(sheet_name) # 在工作簿中新建一个表格 for i in range(0, index): for j in range(0, len(value[i])): sheet.write(i, j, value[i][j]) # 像表格中写入数据(对应的行和列) workbook.save(path) # 保存工作簿 print("xls格式表格写入数据成功!") #

使用Apache POI读取Excel文件

主宰稳场 提交于 2019-12-05 11:42:29
网上关于介绍Apache POI操作Excel的文章已经很多了,但都讲得比较复杂。poi的API 与实际使用中的Excel很类似,可以说是POI把Excel中的workbook、sheet、cell等对象化了,在实际使用中极易理解。但由于Apache POI在存在已有不短时间,至少在excel2007之前就已经出现,造成同样一套Api并不能同时读取(写入)xls和xlsx两种类型的Excel文件。但poi对excel有一个很好的抽象(ss包下的Workbook、Sheet、Cell等类),可以一定程度上忽略xls/xlsx的处理细节,针对其通用部分进行处理,但如果需要对各自有理强的支持,还是建议使用相应的API。 Apache 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格式档案的功能