Sponsored Content
Top Forums Shell Programming and Scripting Shell script - Excel/CSV file - More than one tab Post 302537368 by itkamaraj on Friday 8th of July 2011 02:09:30 AM
Old 07-08-2011
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

editing excel file through shell script

Hi, I am having a business file in excel having charts based on data already present on it. I would like to add new rows after the existing data and refesh the chart on it using shell script. For example-- In excel file in "sheet1", There is some data in first 10 rows ( from column A to F).... (0 Replies)
Discussion started by: sanjay1979
0 Replies

2. Shell Programming and Scripting

How to convert a excel file to a .csv file from unix script

Hi I have a excel file in unix machine and have to convert it into a .csv file.I have to do this from a unix script.How do we do this? Thanks Abhinav (3 Replies)
Discussion started by: akashtcs
3 Replies

3. Shell Programming and Scripting

Convert MS Excel file to Tab limiter file in UNIX

Hi, We have a couple of ms excel files in unix server.We need convert the excel files to files TAB limiter format file with using unix script. Could you please advise on this (2 Replies)
Discussion started by: koti_rama
2 Replies

4. UNIX for Dummies Questions & Answers

Read excel file using shell script

Is it possible to read an excel sheet using shell script ? (2 Replies)
Discussion started by: hiten.r.chauhan
2 Replies

5. Shell Programming and Scripting

Shell Script for converting file to Excel or CSV

Hi I have a dat file which has "n" number of columns. The file is delimited. The number of columns keep varying as the file is generated out of DB queries. Could you please help me in writing a script which will generate a XLS or CSV file out of the dat file. (5 Replies)
Discussion started by: Vee
5 Replies

6. UNIX for Dummies Questions & Answers

How to Create excel file(.csv) using shell script?

Hi, i have shell script which compiles n number of test cases and execute them one by one. i want to create report in excel through script in which two columns namely "test id" and "release".second column have two subcolumns namely compiles and excutes. so i want first column should display test... (15 Replies)
Discussion started by: RamMore123
15 Replies

7. Shell Programming and Scripting

Adding tab to excel sheet with shell script

(1 Reply)
Discussion started by: sagar_1986
1 Replies

8. UNIX for Beginners Questions & Answers

Convert Excel File (xls) to tab delimited text file on AIX

Hi i have a problem in my job i try to convert an excel file (xls extention) to text file (tab delimited), but no result with this comand cat xxx.xls > xxx.txt Do you have eny idea? PS: sorry for my english Thanks!! (4 Replies)
Discussion started by: frisso
4 Replies

9. Shell Programming and Scripting

Trouble reading from a tab delimited excel file

So I have a file1.txt that is tab delimited: e.g. FIELD1 FIELD2 FIELD3 FIELD4 FIELD5 9545641 123 "Neighbor and Labrador,Canada" 54895 'CANADA' 9456465 456 "Neighbor and Labrador,Canada" 54893 'CANADA' 8746512 789 "Neighbor and... (11 Replies)
Discussion started by: dan139
11 Replies

10. Shell Programming and Scripting

Tabbed multiple csv files into one single excel file with using shell script not perl

Hi Experts, I am querying backup status results for multiple databases and getting each and every database result in one csv file. so i need to combine all csv files in one excel file with separate tabs. I am not familiar with perl script so i am using shell script. Could anyone please... (4 Replies)
Discussion started by: ramakrk2
4 Replies
Spreadsheet::ParseExcel::SaveParser(3pm)		User Contributed Perl Documentation		  Spreadsheet::ParseExcel::SaveParser(3pm)

NAME
Spreadsheet::ParseExcel::SaveParser - Rewrite an existing Excel file. SYNOPSIS
Say we start with an Excel file that looks like this: ----------------------------------------------------- | | A | B | C | ----------------------------------------------------- | 1 | Hello | ... | ... | ... | 2 | World | ... | ... | ... | 3 | *Bold text* | ... | ... | ... | 4 | ... | ... | ... | ... | 5 | ... | ... | ... | ... Then we process it with the following program: #!/usr/bin/perl use strict; use warnings; use Spreadsheet::ParseExcel; use Spreadsheet::ParseExcel::SaveParser; # Open an existing file with SaveParser my $parser = Spreadsheet::ParseExcel::SaveParser->new(); my $template = $parser->Parse('template.xls'); # Get the first worksheet. my $worksheet = $template->worksheet(0); my $row = 0; my $col = 0; # Overwrite the string in cell A1 $worksheet->AddCell( $row, $col, 'New string' ); # Add a new string in cell B1 $worksheet->AddCell( $row, $col + 1, 'Newer' ); # Add a new string in cell C1 with the format from cell A3. my $cell = $worksheet->get_cell( $row + 2, $col ); my $format_number = $cell->{FormatNo}; $worksheet->AddCell( $row, $col + 2, 'Newest', $format_number ); # Write over the existing file or write a new file. $template->SaveAs('newfile.xls'); We should now have an Excel file that looks like this: ----------------------------------------------------- | | A | B | C | ----------------------------------------------------- | 1 | New string | Newer | *Newest* | ... | 2 | World | ... | ... | ... | 3 | *Bold text* | ... | ... | ... | 4 | ... | ... | ... | ... | 5 | ... | ... | ... | ... DESCRIPTION
The "Spreadsheet::ParseExcel::SaveParser" module rewrite an existing Excel file by reading it with "Spreadsheet::ParseExcel" and rewriting it with "Spreadsheet::WriteExcel". METHODS
Parser new() $parse = new Spreadsheet::ParseExcel::SaveParser(); Constructor. Parse() $workbook = $parse->Parse($sFileName); $workbook = $parse->Parse($sFileName , $formatter); Returns a "Workbook" object. If an error occurs, returns undef. The optional $formatter is a Formatter Class to format the value of cells. Workbook The "Parse()" method returns a "Spreadsheet::ParseExcel::SaveParser::Workbook" object. This is a subclass of the Spreadsheet::ParseExcel::Workbook and has the following methods: worksheets() Returns an array of "Worksheet" objects. This was most commonly used to iterate over the worksheets in a workbook: for my $worksheet ( $workbook->worksheets() ) { ... } worksheet() The "worksheet()" method returns a single "Worksheet" object using either its name or index: $worksheet = $workbook->worksheet('Sheet1'); $worksheet = $workbook->worksheet(0); Returns "undef" if the sheet name or index doesn't exist. AddWorksheet() $workbook = $workbook->AddWorksheet($name, %properties); Create a new Worksheet object of type "Spreadsheet::ParseExcel::Worksheet". The %properties hash contains the properties of new Worksheet. AddFont $workbook = $workbook->AddFont(%properties); Create new Font object of type "Spreadsheet::ParseExcel::Font". The %properties hash contains the properties of new Font. AddFormat $workbook = $workbook->AddFormat(%properties); The %properties hash contains the properties of new Font. Worksheet Spreadsheet::ParseExcel::SaveParser::Worksheet Worksheet is a subclass of Spreadsheet::ParseExcel::Worksheet. And has these methods : The "Worksbook::worksheet()" method returns a "Spreadsheet::ParseExcel::SaveParser::Worksheet" object. This is a subclass of the Spreadsheet::ParseExcel::Worksheet and has the following methods: AddCell $workbook = $worksheet->AddCell($row, $col, $value, $format [$encoding]); Create new Cell object of type "Spreadsheet::ParseExcel::Cell". The $format parameter is the format number rather than a full format object. To specify just same as another cell, you can set it like below: $row = 0; $col = 0; $worksheet = $template->worksheet(0); $cell = $worksheet->get_cell( $row, $col ); $format_number = $cell->{FormatNo}; $worksheet->AddCell($row +1, $coll, 'New data', $format_number); TODO
Please note that this module is currently (versions 0.50-0.60) undergoing a major restructuring and rewriting. Known Problems You can only rewrite the features that Spreadsheet::WriteExcel supports so macros, graphs and some other features in the original Excel file will be lost. Also, formulas aren't rewritten, only the result of a formula is written. Only last print area will remain. (Others will be removed) AUTHOR
Maintainer 0.40+: John McNamara jmcnamara@cpan.org Maintainer 0.27-0.33: Gabor Szabo szabgab@cpan.org Original author: Kawai Takanori kwitknr@cpan.org COPYRIGHT
Copyright (c) 2009-2010 John McNamara Copyright (c) 2006-2008 Gabor Szabo Copyright (c) 2000-2002 Kawai Takanori and Nippon-RAD Co. OP Division All rights reserved. You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file. perl v5.10.1 2010-09-17 Spreadsheet::ParseExcel::SaveParser(3pm)
All times are GMT -4. The time now is 03:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy