Copy Data from CSV file to Excel Sheet using Perl


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Copy Data from CSV file to Excel Sheet using Perl
# 1  
Old 12-31-2012
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, then after that I want to copy the data from data.csv file to result.xls in Sheet2. I have searched many modules but could not find a solid answer
# 2  
Old 12-31-2012
PERL has both CSV and XLS handling capabilities. Google overflows with examples: Delete a sheet from Excel

Of course, you might want to just delete the sheet 2 cell contents and then put in new cells.

CSV to Excel Converter
# 3  
Old 01-01-2013
Hi, This is creating the new excel file and then writing into it, But what I want is I have a already existing excel, in which I want to write

---------- Post updated at 06:30 AM ---------- Previous update was at 12:50 AM ----------

Hi I have done the task, But one issue I am getting, I have one excel file which contains two sheets named Sheet1 and Sheet2,
Basically on Sheet1 there is some pivot formulas are applied by taking the data range from Sheet2, when I update the Sheet 2 with new data with the help of Perl The formulas on Sheet1 goes blanks.
How to avoid such type of condition
# 4  
Old 01-01-2013
Perhaps more of an Excel issue

I would think the 'paste-specia-valuesl' command within Excel would help with your problem. Not sure if that can be done externally, from Perl or other scripts, however.
# 5  
Old 01-01-2013
It will be better if you explain with the help of example
and how paste-special values command will work with Perl
# 6  
Old 01-01-2013
As I said
Quote:
Not sure if that can be done externally, from Perl or other scripts, however.
But, I often use the paste-special-values option within Excel when working with complex formulas and analysis across multiple worksheet tabs. This seems to work best at keeping all my other formulas in-tact and not automatically adjusting them.

So... not sure how to do externally from a unix perl script. Perhaps the perl script could start an Excel macro that would then do the paste-special-values.
# 7  
Old 01-02-2013
spreadsheet - How can I modify an existing Excel workbook with Perl? - Stack Overflow deals with updates, but it is sometimes a better idea to make a new spreadsheet, save the old one and move the new one into its place. What if, for some reason, the updated copy is not viable?

Also, there is a new, upwards compatible library: Spreadsheet::WriteExcel is dead. Long live Excel::Writer::XLSX. - Perlbuzz
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Summing up the data from different excel sheet into one excel sheet

Hi Folks, Can you please advise for any script in unix such that for example , i have 3 different excel sheet at the location /ppt/gfr/exc so the name s of the excel sheet are 1excel.xslx 2excel.xslx 3excel.xslx now in these 3 different excel sheet there is lot of data for example each... (3 Replies)
Discussion started by: punpun66
3 Replies

2. Shell Programming and Scripting

Save log data in excel sheet

Hello, I have the following data format in a log file : a : x1 b : x2 c : x3 d : x4 -------- a : x5 b : x6 c : x7 d : x8 so the same fields ( a ,b ,c,d) repeated many times in the same log file but with different "x" values (x5,x6,x7,x8). I need a script to save this data in an... (6 Replies)
Discussion started by: mm00123
6 Replies

3. UNIX for Dummies Questions & Answers

UNIX data to be updated to ms excel sheet

hi, i wanted to add unix data to be updated to the excel sheet. (3 Replies)
Discussion started by: rupesh.bombale
3 Replies

4. UNIX for Dummies Questions & Answers

Load UNIX data into excel sheet

Hi, i have some data in a temporary file in Unix (the data is taken from the result of an SQL query). Now i want to dump that data into an excel sheet. How to do that. Someone please advise. Thanks Regards, Vinit (3 Replies)
Discussion started by: vinit raj
3 Replies

5. Shell Programming and Scripting

Perl : to get all the hyperlinks from the xlsx sheet(hyperlinks not visible in excel sheet directly)

Hi folks, I have a requirement in perl to print all the hyperlink from the spreadsheet(xlsx). Spreadsheet contains few lines of hyperlink data (pic attached). P.S. Hyperlink is behind the data and not visible in excel sheet directly. Now using perl script I need to copy the hyperlinks in... (3 Replies)
Discussion started by: scriptscript
3 Replies

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

7. Shell Programming and Scripting

mail a csv file as an excel sheet!

Hi, The result of a script is a csv file in the following format: cat $file_name DATA_USAGE_FACT,YES_NO_FLG,TARGET_TABLE,YES_NO_FLG,1,0,15,0 DATA_USAGE_FACT,DATE_OF_CREATION,TARGET_TABLE,DATE_OF_CREATION,29,9,19,0 DATA_USAGE_FACT,UPDATION_DATE,TARGET_TABLE,UPDATION_DATE,29,9,19,0... (3 Replies)
Discussion started by: dips_ag
3 Replies

8. Shell Programming and Scripting

how to copy data to to excel file

Hi, Can any one tell me how to copy data using shell script to a excel file from text file to other columns of excel file,leaving first column unaffected i.e it should not overwrite data in first column. Say my text file data is: 15-dec-2008 15-dec-2009 16-dec-2008 16-dec-2009 ... (7 Replies)
Discussion started by: tucs_123
7 Replies

9. UNIX for Advanced & Expert Users

how to read the data from an excel sheet and use those data as variable in the unix c

I have 3 columns in an excel sheet. c1 c2 c3 EIP_ACCOUNT SMALL_TS_01 select A.* from acc; All the above 3 col shoud be passed a variable in the unix code. 1.How to read an excel file 2.How to pass these data as variable to the unic script (1 Reply)
Discussion started by: Anne Grace
1 Replies

10. UNIX for Advanced & Expert Users

Insert csv into special sheet of excel

Hi, I need a script that can insert csv file into the special sheet of excel (other sheets in this excel include charts which use data of the special sheet). Could you help me please? (2 Replies)
Discussion started by: Elena
2 Replies
Login or Register to Ask a Question