xls

Read only specific sheet

大憨熊 提交于 2019-12-30 03:50:09
问题 I am trying to read just one sheet from an xls document and I have this: $objPHPExcel = $objReader->load('daily/' . $fisierInbound); $objWorksheet = $objPHPExcel->setActiveSheetIndex(0); foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) { $worksheetTitle = $worksheet->getTitle(); $highestRow = $worksheet->getHighestRow(); // e.g. 10 $highestColumn = $worksheet->getHighestColumn(); // e.g 'F' $highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn); $dataCalls =

django download csv file using a link

别说谁变了你拦得住时间么 提交于 2019-12-30 00:07:27
问题 I am a new to django and python. Need some guidance in this quest. Case: When the user hits the submit button on a form, it should display Success page and a link where they can download the results. The results are in excel file. I can create output to excel file using xlwt module and display the success page individually but not both at the same time. What i have: I am running django1.1.1 on windows XP with python 2.6. There was similar question asked but was not able to make it work. my

django download csv file using a link

陌路散爱 提交于 2019-12-30 00:07:21
问题 I am a new to django and python. Need some guidance in this quest. Case: When the user hits the submit button on a form, it should display Success page and a link where they can download the results. The results are in excel file. I can create output to excel file using xlwt module and display the success page individually but not both at the same time. What i have: I am running django1.1.1 on windows XP with python 2.6. There was similar question asked but was not able to make it work. my

Converting multiple tab-delimited .txt files into multiple .xls files

走远了吗. 提交于 2019-12-29 08:02:05
问题 I am a newbie to python and I am trying to do what the title above says with the code displayed below. It runs up to the point where I ask to save the xls output. Any help would be very much appreciated. import glob import csv import xlwt for filename in glob.glob("C:\xxxx\*.txt"): wb = xlwt.Workbook() sheet = wb.add_sheet('sheet 1') newName = filename spamReader = csv.reader(open(filename, 'rb'), delimiter=';',quotechar='"') for rowx, row in enumerate(spamReader): for colx, value in

python操作Excel(xlwt、xlrd、xlutils)

梦想与她 提交于 2019-12-27 20:36:26
简介 python中通过xlwt、xlrd和xlutils三个模块操作xls文件。这三个模块的区别如下: xlwt:xlwt用于在内存中生成一个xlsx/xls对象,增加表格数据,并把内存中的xls对象保存为本地磁盘xls文件。 xlrd:xlrd用于把本地xls文件加载到内存中,可以读取xls文件的表格数据,查询xls文件的相关信息。 xlutils:xlutils模块是xlrd和xlwt之间的桥梁,读取xls文件可以使用xlrd,新建创建文件可以使用xlwt,而修改文件则使用xlutils;可以使用xlutils模块中的copy模块拷贝一份通过xlrd读取到内存中的xls对象,就可以在拷贝对象上像xlwt中那样修改xls表格的内容,并保存到本地。 除此之外,还有一些其他的模块也可以用于操作excel文件,如xlwings、openyxl、xlsxwriter、win32com和pandas库 三个模块的安装方法 还是使用pip指令进行安装,具体如下: xlwt: pip install xlwt xlrd: pip install xlrd xlutils: pip install xluntils 使用示例 1、创建excel文件——xlwt的用法 # 创建一个excel对象 excel = xlwt . Workbook ( ) # 然后添加一个sheet表单 sheet1

How to check is upload file is CSV or XLS

大城市里の小女人 提交于 2019-12-25 04:38:24
问题 I upload CSV or XLS file and import that file content in to the data base. There is two separate method for read CSV and XLS file read( readCSV() and readXLS() ). when i upload CSV or XLS file that gave to me same file type if(file_type($my_file) =='CSV'){ readCSV(); }else{ readXLS(); } How can i write file_type() function for get separate result for CSV and XLS files 回答1: <?php $chunks = basename($your_file_path).explode('.'); if(strtolower($chunks[count($chunks)-1]) == 'csv'){ //csv }else{

How to save data on excel xls file using perl?

跟風遠走 提交于 2019-12-25 03:34:08
问题 I'm able to save the excel file as .csv using perl like this : print "Content-type: application/vnd.ms-excel\n"; print "Content-Disposition: attachment;filename=\"file name.xls\"\n\n"; print"Fruits, Cost"; #Then looping on the results. Yet I need to save this as .xls cause I want to use colours. Any one can help? 回答1: I highly recommend Spreadsheet::WriteExcel for your needs. The library is entirely written in Perl, so all you need to do is upload the CPAN library to your web site and specify

Calling function in XLL file from C#

牧云@^-^@ 提交于 2019-12-25 03:30:34
问题 I have a xll file which have a function and I want to call that function from C#. This xll file is used in excel.any body have idea how to do that?.I tried refrencing the xll file but I am not getting the value.If I open excel like start-->programms-->excel and in excel if i directly give the function I am getting right value.Same thing If i automate excel in c# and opened excel from Microsoft.Office.Interop.Excel and applied the function I am getting error 回答1: You probably won't be able to

VB.NET - Reading ENTIRE content of an excel file

*爱你&永不变心* 提交于 2019-12-24 10:48:55
问题 I already know the basic procedure of how to read specific cells of an .xls file using VB.NET but I can't figure out how to automatically get all the data from such a file. Basically, I'm obtaining the data like this: Dim xlApp As Excel.Application Dim wb As Workbook Dim ws As Worksheet xlApp = New Excel.Application wb = xlApp.Workbooks.Open("myfile.xls") ws = wb.Worksheets("worksheet1") For Each cell In ws.Range("A1", "C10") Console.WriteLine(cell.value) Next In this case, I know that there

Protect excel file with java

。_饼干妹妹 提交于 2019-12-24 10:46:39
问题 Is there a way to create open protected excel file in Java? I'm looking at JExcelApi and Apache Poi projects but with both of them I cannot figure out how to protect generated xls file. I want to assure that generated file can be opened only by people that know password phrase. 回答1: I would recommend using JACOB (COM->Java bridge), and control Excel via COM automation. This will, of course, require that Excel be installed on the machine in question. 回答2: One trick I've found when using POI is