Shell script for dealing with XLS file with multiple tabs/worksheets


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Shell script for dealing with XLS file with multiple tabs/worksheets
# 1  
Old 04-17-2014
Shell script for dealing with XLS file with multiple tabs/worksheets

Hey Guys ,

Recently working on a requirement , i had to deal with XLS file with multiple tabs and the requirement was as below :

1. Convert one XLS file with multiple tabs to multiple CSV files.
-- As i was working on MAC , so it was quite easy through APPLESCRIPT to deal with this.But during this , i read lots of forum and learnt that UNIX shell scripting do not have any utility or solution for this.Is this really true?bcaz i everywhere found ppl recommending PERL or other stuff .

----------------------
Real Problem.
----------------------
2. Once Files are converted to CSV , we have to rename all CSV files with names as in different tab from XLS i.e first CSV should be named as the first tab in that XLS and so on .

Is there anyway in scripting to capture those tab names from XLS?

and if not , what alternative i should try to make this happen ?

I am eagerly looking forward for your replies.

Cheers!!!
Himanshu Sood

Last edited by himanshu sood; 04-17-2014 at 11:29 PM..
# 2  
Old 04-17-2014
Can you show some example data how the xls is looking alike?
You probably dont have to rename the files in a second appraoch if you save them as the 'tab/register' name in the first place.

Cheers
# 3  
Old 04-17-2014
Hello Sea ,

I have added a xls for ur reference.
You will see 3 sheets in that and the new csv files need to have those names in it .

E.g :-
Origin File Name :- 20130430_Himanshu.xls

CSV File Name :-
20130430_DE000A0V7550_Himanshu.csv
20130430_DE000A0V7568_Himanshu.csv
20130430_DE000A0V7570 _Himanshu.csv

Hope its clear to you .

Thanks,
Himanshu Sood
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script to encrypt the xls file using executable jar in Linux SUSE 11.4

Dear Experts, I am an ERP consultant and would like to learn shell script. We are working on Linux SUSE 11.4 and I am very new to shell scripting. We can manually encrypt an excel file using "executable jar" through command prompt by placing the jar file & the file to be encrypted on a physical... (1 Reply)
Discussion started by: nithin226
1 Replies

2. Shell Programming and Scripting

Merging Multiple XLS into Different tabs in xls/ xlsx

HI, I have multiple files per dept in folder for eg : In a folder File1_Dept100.xls File2_Dept100.xls File3_Dept100.xls File1_Dept200.xls File2_Dept200.xls File3_Dept200.xls Output should be : Dept100.xls which has File1, File2, File3 in different tabs Dept200.xls which has... (1 Reply)
Discussion started by: venkyzrocks
1 Replies

3. Emergency UNIX and Linux Support

Dealing with XLS file with multiple tabs

Hey Guys , Recently working on a requirement , i had to deal with XLS file with multiple tabs and the requirement was as below : 1. Convert one XLS file with multiple tabs to multiple CSV files. -- As i was working on MAC , so it was quite easy through APPLESCRIPT to deal with this.But... (6 Replies)
Discussion started by: himanshu sood
6 Replies

4. UNIX for Dummies Questions & Answers

Download .xls file from mail and copy to another path using shell script

Hi I have a mail attachment coming from a mail id and evreytime with the same name in .xls format.I have to download the .xls file into a location and convert it itno .csv format and copy the .csv file to another location. (1 Reply)
Discussion started by: bikky6
1 Replies

5. Shell Programming and Scripting

Converting huge xls(having multiple tabs) to csv

hello I have browsed for the similar requirement i found this https://www.unix.com/shell-programming-scripting/40163-xls-csv-conversion.html but my problem is i have multiple tabs in xls file having same metadata I want to convert it into single csv file any ways to do it pls... (5 Replies)
Discussion started by: joshiamit
5 Replies

6. Shell Programming and Scripting

Conversion of below Tabs Tex file into CSV format file : shell script needed

Request if some one could provide me shell script that converts the below "input file" to "CSV format file" given Name Domain Contact Phone Email Location ----------------------- ------------------------------------------------ ------- ----- ---------------------------------... (7 Replies)
Discussion started by: sreenath1037
7 Replies

7. Shell Programming and Scripting

Removing worksheets from xls using unix.

HI All, I have a .xls file , in which I have multiple worksheets , I need to remove all the worksheets except the worksheet by name CDR_LOAD_STATS, how can I do this in unix. Please guide me. Regards, Deepti (7 Replies)
Discussion started by: gaur.deepti
7 Replies

8. Shell Programming and Scripting

Dealing with spaces in file names in a shell script

Hi, What's the best way to find all files under a directory - including ones with space - in order to apply a command to each of them. For instance I want get a list of files under a directory and generate a checksum for each file. Here's the csh script: #!/bin/csh set files = `find $1... (5 Replies)
Discussion started by: same1290
5 Replies

9. UNIX for Advanced & Expert Users

Creating multiple worksheets in CSV file

Hello, I've been tasked with sending 3 types of data (file size, row count, and file name) to a csv file every month for various vendors. I have been asked to put this in one csv or xls file with each vendor being a different tab (or worksheet). Until now, we have been finding and emailing... (4 Replies)
Discussion started by: tekster757
4 Replies

10. Shell Programming and Scripting

copying the csv file into different worksheets of xls file

Hi, I have a script which will generate three csv files. i want to copy the contents of these csv files into a .XLS file but in different worksheets. Can a this be done in the same script? :confused: Can Perl come to my help in coping the csv files into different worksheets of .XLS file ?... (0 Replies)
Discussion started by: nimish
0 Replies
Login or Register to Ask a Question