PERL: Modify Excel cell formatting


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting PERL: Modify Excel cell formatting
# 1  
Old 10-03-2008
PERL: Modify Excel cell formatting

Hi,

I would like to modify an existing excel cell format to a custom format.
Is there a way to do it with out writing into a new excel file.
In-place editing?

Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parse excel file with html on each cell

<DIV><P>Pré-condição aceder ao ecrã Home do MRS.</P></DIV><DIV><P>OK.</P></DIV><DIV><P>Seleccionar Pesquisa de Recepção Directa.</P></DIV><DIV><P>Confirmar que abriu ecrã de Recepção Directa.</P></DIV><DIV> (6 Replies)
Discussion started by: oliveiraum
6 Replies

2. UNIX for Advanced & Expert Users

awk - If then else rule like Excel cell

Hi, I need extract / transpose where "Y" in the input file My input file is Item,EB,SB,SD,TP,GR LP,Y,N,N,N,Y GC,Y,N,N,N,N CO,N,Y,Y,Y,Y PS,Y,N,N,Y,Y Expecting output is EB-/'LP/',/'GC/',/'PS/' SB-/'CO/' SD-/'CO/' TP-/'CO/',/'PS/' GR-LP,CO,PS I appreciate for your help Regards (4 Replies)
Discussion started by: myrole
4 Replies

3. Shell Programming and Scripting

Perl script to Merge contents of 2 different excel files in a single excel file

All, I have an excel sheet Excel1.xls that has some entries. I have one more excel sheet Excel2.xls that has entries only in those cells which are blank in Excel1.xls These may be in different workbooks. They are totally independent made by 2 different users. I have placed them in a... (1 Reply)
Discussion started by: Anamika08
1 Replies

4. Shell Programming and Scripting

Writing excel file using perl : Excel file formatting changed

I am trying to create a program where user can input data in certain excel cells using user interface on internet....the programming is on perl and server is unix But when i parse data into excel the formatting of sheets is turned to default and all macro coding removed. What to do...Please... (7 Replies)
Discussion started by: mud_born
7 Replies

5. Shell Programming and Scripting

Perl - Append data to existing excel cell

Hello All, I have the following code in PERL to write data to excel sheet. Can someone please help me about how to append data to an exisitng cell? For ex in the below given case,Cell 1,1 has Active State PERL Now I want to add a new line like "prorgamming" without overwritting the... (3 Replies)
Discussion started by: prasperl
3 Replies

6. Shell Programming and Scripting

Help to modify in Excel format

Hi I ran some query in solaris machine and the result of the query is as below. Result: dn: uid=xxx,dc=example,dc=com id: xxx firstname: sam lastname: nam But my question is , how to get result in excel format in solaris and result attributes dn,id,firstname,lastname values ... (1 Reply)
Discussion started by: buzzme
1 Replies

7. Shell Programming and Scripting

modify Existing MS excel workbook in perl

Hi I need to modify an excel file in perl and for which I installed perl in Linux 1. Open a existing excel file 2. delete an unwanted Sheet called "summary" 3. and i want to insert some data into range of cells ( B1:B11) 4. Remove unwanted value called "Sum" repeated in the... (1 Reply)
Discussion started by: luke_devon
1 Replies

8. Shell Programming and Scripting

Export into a single cell of excel sheet...

The awk is giving below output: SELECT divrel.child_org_idn org_main_idn NULL ( VARCHAR(200)) div_nam_2 NULL ( VARCHAR(200)) div_nam_3 NULL ( VARCHAR(200)) div_nam_4 NULL ( VARCHAR(200)) div_nam_5 NULL ( VARCHAR(200)) div_nam_6 NULL ( VARCHAR(200)) div_nam_7 ... (2 Replies)
Discussion started by: goutam_igate
2 Replies

9. Shell Programming and Scripting

How to change cell background in excel sheet using perl

I need to change a cell in an excel sheet to different background color using perl.I tried SaveParse, but was unable to get it Please help regarding this. Thanks and Regards, Neelam G https://www.unix.com/images/misc/progress.gif (0 Replies)
Discussion started by: gujrathinr
0 Replies

10. UNIX for Dummies Questions & Answers

Change the cell background in excel sheet using Perl

I need to change a cell in an excel sheet to different background color using perl. Please help regarding this. Thanks and Regards, Neelam G (1 Reply)
Discussion started by: gujrathinr
1 Replies
Login or Register to Ask a Question
Spreadsheet::ParseExcel::Cell(3pm)			User Contributed Perl Documentation			Spreadsheet::ParseExcel::Cell(3pm)

NAME
Spreadsheet::ParseExcel::Cell - A class for Cell data and formatting. SYNOPSIS
See the documentation for Spreadsheet::ParseExcel. DESCRIPTION
This module is used in conjunction with Spreadsheet::ParseExcel. See the documentation for Spreadsheet::ParseExcel. Methods The following Cell methods are available: $cell->value() $cell->unformatted() $cell->get_format() $cell->type() $cell->encoding() $cell->is_merged() $cell->get_rich_text() value() The "value()" method returns the formatted value of the cell. my $value = $cell->value(); Formatted in this sense refers to the numeric format of the cell value. For example a number such as 40177 might be formatted as 40,117, 40117.000 or even as the date 2009/12/30. If the cell doesn't contain a numeric format then the formatted and unformatted cell values are the same, see the "unformatted()" method below. For a defined $cell the "value()" method will always return a value. In the case of a cell with formatting but no numeric or string contents the method will return the empty string ''. unformatted() The "unformatted()" method returns the unformatted value of the cell. my $unformatted = $cell->unformatted(); Returns the cell value without a numeric format. See the "value()" method above. get_format() The "get_format()" method returns the Spreadsheet::ParseExcel::Format object for the cell. my $format = $cell->get_format(); If a user defined format hasn't been applied to the cell then the default cell format is returned. type() The "type()" method returns the type of cell such as Text, Numeric or Date. If the type was detected as Numeric, and the Cell Format matches "m{^[dmy][-\/dmy]*$}i", it will be treated as a Date type. my $type = $cell->type(); See also "Dates and Time in Excel". encoding() The "encoding()" method returns the character encoding of the cell. my $encoding = $cell->encoding(); This method is only of interest to developers. In general Spreadsheet::ParseExcel will return all character strings in UTF-8 regardless of the encoding used by Excel. The "encoding()" method returns one of the following values: o 0: Unknown format. This shouldn't happen. In the default case the format should be 1. o 1: 8bit ASCII or single byte UTF-16. This indicates that the characters are encoded in a single byte. In Excel 95 and earlier This usually meant ASCII or an international variant. In Excel 97 it refers to a compressed UTF-16 character string where all of the high order bytes are 0 and are omitted to save space. o 2: UTF-16BE. o 3: Native encoding. In Excel 95 and earlier this encoding was used to represent multi-byte character encodings such as SJIS. is_merged() The "is_merged()" method returns true if the cell is merged. my $is_merged = $cell->is_merged(); Returns "undef" if the property isn't set. get_rich_text() The "get_rich_text()" method returns an array ref of font information about each string block in a "rich", i.e. multi-format, string. my $rich_text = $cell->get_rich_text(); The return value is an arrayref of arrayrefs in the form: [ [ $start_position, $font_object ], ..., ] Returns undef if the property isn't set. Dates and Time in Excel Dates and times in Excel are represented by real numbers, for example "Jan 1 2001 12:30 PM" is represented by the number 36892.521. The integer part of the number stores the number of days since the epoch and the fractional part stores the percentage of the day. A date or time in Excel is just like any other number. The way in which it is displayed is controlled by the number format: Number format $cell->value() $cell->unformatted() ============= ============== ============== 'dd/mm/yy' '28/02/08' 39506.5 'mm/dd/yy' '02/28/08' 39506.5 'd-m-yyyy' '28-2-2008' 39506.5 'dd/mm/yy hh:mm' '28/02/08 12:00' 39506.5 'd mmm yyyy' '28 Feb 2008' 39506.5 'mmm d yyyy hh:mm AM/PM' 'Feb 28 2008 12:00 PM' 39506.5 The Spreadsheet::ParseExcel::Utility module contains a function called "ExcelLocaltime" which will convert between an unformatted Excel date/time number and a "localtime()" like array. For date conversions using the CPAN "DateTime" framework see DateTime::Format::Excel http://search.cpan.org/search?dist=DateTime-Format-Excel 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-2006 Kawai Takanori 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::Cell(3pm)