Perl - Append data to existing excel cell


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Perl - Append data to existing excel cell
# 1  
Old 02-14-2013
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 existing content.

Is there a way to do it?

Code:
my $workbook = Spreadsheet::WriteExcel->new($FileName);
## Add a worksheet
my $worksheet1 = $workbook->add_worksheet('PERL');
## Define the format and add it to the worksheet
my $format = $workbook->add_format(
#center_across => 1,
bold => 1,
size => 10,
border => 4,
color => 'black',
bg_color => 'cyan',
border_color => 'black',
align => 'vcenter',
);
## Change width for only first column
$worksheet1->set_column(0,0,20);
my $failcolor= $workbook->add_format(
bold => 1,
size => 10,
border => 4,
color => 'red',
border_color => 'black',
align => 'vcenter',
);
 

# Write a formatted and unformatted string, row and column
# notation.
$worksheet1->write(0,0, "PERL FLAVOURS",$format);
$worksheet1->write(1,1,"Active State PERL",$failcolor);
$worksheet1->write(2,0,"Strawberry PERL");
$worksheet1->write(3,0,"Vennila PERL");

# 2  
Old 02-14-2013
I see no way. It must create the file on-the-fly... Assemble your data first, create the spreadsheet when you're finished, no sooner.
# 3  
Old 02-14-2013
Yes.I though of that.

the constraint for me is that I have to print multicolour text inside the same line.

Like "The process has started but results breach threshold-failed"

If we construct all the content and print in one go then I think we can have only one color/format
# 4  
Old 02-14-2013
There appear to be methods for VB macros to do multi-colored text in one cell, but don't think it's supported by WriteExcel
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 : not capturing all the data from excel sheet

Hi folks, I am working on assignment that captures all the records(2 columns one column contains names and other contain date of birth) from excel sheet stored in a directory and checks for current date and month. If it matches current date and month then the matched records are printed as... (1 Reply)
Discussion started by: giridhar276
1 Replies

4. Shell Programming and Scripting

how to validate data of excel using perl or shell

I have a software which generates excel report with some specific data. The excel file format is .xls (old 2003 format) The data are in the forms like differenct cells contains numeric, string and alphanumeric data. The data per cell for specific input data is fixed. I need to retrive specific... (5 Replies)
Discussion started by: PratLinux
5 Replies

5. Shell Programming and Scripting

How to delete already existing data in a file using perl? Pls help me!!

Dear Friends, I need urgent help from u.. I have two files,file1 & file 2.. file1 have a existing data of file2.So i want to delete those existing datas from file1 (which contain the data from file1) My file1 like this rs39348 1 1045729 A G 0.1791 0.2054 0.84 ... (3 Replies)
Discussion started by: sureshraj
3 Replies

6. 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

7. 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

8. Shell Programming and Scripting

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 (0 Replies)
Discussion started by: sandeep78
0 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