PERL - [B]Cloning[/B] an Excel file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting PERL - [B]Cloning[/B] an Excel file
# 1  
Old 01-11-2005
MySQL PERL - [B]Cloning[/B] an Excel file

Hi

I plan to read an excel file (using Spreadsheet::ParseExcel) and create a clone of it with some other name (using Spreadsheet::WriteExcel).

I am able to get the skeleton by reading cells in every[row,column] pair of every worksheet. But I am not able to get the format string of these cells. I want the clone to reflect the formatting present in the parent as well!

http://search.cpan.org/~kwitknr/Spreadsheet-ParseExcel-0.2603/ParseExcel.pm#Formatter_class
is supposed to help me out here. But the usage is not very user-friendly!

Could someone help me out here.

Thanks,
Yuga
# 2  
Old 01-11-2005
Incorrect URL

The URL which I had specified in my request is incorrect.

Following is the correct URL:
Formatter Class

Thanks,
Yuga
# 3  
Old 01-11-2005
Surely if you want to clone (i.e. create an exact copy), you could just do

system( "cp /my/oldfile.xls /my/newfile.xls" );

What's the point reading the whole file in and writing it out again if you just want to copy it?

Cheers
ZB
# 4  
Old 01-11-2005
Hi zazzybob!

My requirement is to automate row additions into excel files. Since there is no module which lets me append rows to worksheets in an excel file, I decided to first clone the file (into a temporary file), append rows into the temporary file (once I complete cloning) and then save the temporary file as the original file (which I intended to append).

This way, I kind of simulate an append into an excel file.

'cp' would not help me!
# 5  
Old 01-11-2005
You can try to write a macro in VB, embedded in the excel file.
The marco will do the importing of data from, say... text file in a directory.

You have to ftp, NFS, etc ... share the file from unix to windows..
# 6  
Old 01-11-2005
Hey izy100, thats a pretty interesting and intelligent suggestion. I am a newbie to using Macros in VBScript. Well let me try to work this out.

Thanks for this suggestion Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl script to fill the entire row of Excel file with color based on pattern match

Hi All , I have to write one Perl script in which I need to read one pre-existing xls and based on pattern match for one word in some cells of the XLS , I need to fill the entire row with one color of that matched cell and write the content to another excel Please find the below stated... (2 Replies)
Discussion started by: kshitij
2 Replies

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

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

Copy Data from CSV file to Excel Sheet using Perl

Hi All, Firstly I will like to wish A Happy New Year to all. Now my issue is I have one csv file say(data.csv) and one excel file say(result.xls) The result.xls contains two sheet name Sheet1 and Sheet2, Now What I am trying to do is to First I want to delete that data of Sheet2 if present any,... (6 Replies)
Discussion started by: adisky123
6 Replies

6. Shell Programming and Scripting

perl problem in processing excel file

Dear all, I got a perl script to write some data into an excel file using Spreadsheet::ParseExcel::SaveParser. After that I find all formulas in the excel file are gone. Does any body encounter this problem or have any work around? (2 Replies)
Discussion started by: eldonlck
2 Replies

7. UNIX and Linux Applications

Perl Script to read an excel file into an array and search in the UNIX directories

Hi, I want the Perl script with versions 5.8.2 and 5.8.5 starting with #!/usr/bin/perl The Perl program should read the excel file or text file line by line and taking into an array and search in the UNIX directories for reference file of .jsp or .js or .xsl with path .The Object names... (2 Replies)
Discussion started by: pasam
2 Replies

8. Shell Programming and Scripting

creating excel file using perl

Hi , I am writing a simple excel file and want to create the file under say 'D:\Documents and Settings'. The problem with my code is it is writing in the same directory instead of the specified. Here is a sample code use Spreadsheet::WriteExcel; my $workbook =... (1 Reply)
Discussion started by: daptal
1 Replies

9. Shell Programming and Scripting

Perl script to sort an Excel file

Hello! I need to sort a file that is partly in English partly in Bulgarian. The original file is an Excel file but I converted it to a tab-delimited text file. The encoding of the tab delimited file is UTF-8. To sort the text, the script should test every line of the text file to see if... (9 Replies)
Discussion started by: degoor
9 Replies

10. Shell Programming and Scripting

PERL: Split Excel Workbook to Indiv Excel files

Hi, I am trying to find a way to read an excel work book with multiple worksheets. And write each worksheet into a new excel file using perl. My environment is Unix. For example: I have an excel workbook TEST.xls and it has Sheet1, Sheet2, Sheet3 worksheets. I would like to create... (2 Replies)
Discussion started by: sandeep78
2 Replies
Login or Register to Ask a Question