Distibution of Excel file.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Distibution of Excel file.
# 1  
Old 09-06-2012
Distibution of Excel file.

Hi,
I have a requirement where I have list of Excel files (with multiple tabs) placed in Unix directory.The naming convention is [Timestamp]_<Code> where <Code> is unique indentifier for each file. In a database table, I have Distribution list for each code. I want to write a shell script , which will basically pick each file one by one , Check for <Code> value, Connect to database to extract distribution list and send the Excel file to distribution via email. Please help me with the sample script to capture this requirement.

Thanks for you help.
Anil Kumar
# 2  
Old 09-06-2012
distribution answer

Hi Anil,

select * from distribution;
1 a.b@gmail.com
2 b.b@gmail.com
3 b.c@gmail.com
4 t.c@gmail.com
5 tt.c@gmail.com
##################
Code:
 
cd /home/beherabi/dist
for i in `ls -1|cut -d "_" -f2`
do
a=`sqlplus -s scott/tiger@orcl<<here
set heading off;
select dist from distribution where unival=$i;
exit;
here`
echo "$a"
done

####################
will give the output
Quote:
so you need to change the line(echo "$a") to some corresponding sendmail or other
mailing utility with your excel file and the distribution(which is nothing but the $a).
hope this will help you
Regards,
sanjay.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Convert Excel File (xls) to tab delimited text file on AIX

Hi i have a problem in my job i try to convert an excel file (xls extention) to text file (tab delimited), but no result with this comand cat xxx.xls > xxx.txt Do you have eny idea? PS: sorry for my english Thanks!! (4 Replies)
Discussion started by: frisso
4 Replies

2. Shell Programming and Scripting

Need help to write a shell script to convert text file to excel file.

Hi Everyone, I want your help to write a script which will take text file as input and on the basis of delimiter ":"script will create excel sheet. Example input: IpAdress:InstanceName:Port:ServerName 10.255.255.1:abc:2232:xyz_abc Output should be an excel sheet like below: Column... (8 Replies)
Discussion started by: akabhinav18
8 Replies

3. Shell Programming and Scripting

Script to generate Excel file or to SQL output data to Excel format/tabular format

Hi , i am generating some data by firing sql query with connecting to the database by my solaris box. The below one should be the header line of my excel ,here its coming in separate row. TO_CHAR(C. CURR_EMP_NO ---------- --------------- LST_NM... (6 Replies)
Discussion started by: dani1234
6 Replies

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

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

6. Shell Programming and Scripting

How to convert excel file to csv file or text file?

Hi all, I need to find a way to convert excel file into csv or a text file in linux command. The reason is I have hundreds of files to convert. Another complication is the I need to delete the first 5 lines of the excel file before conversion. so for instance input.xls description of... (6 Replies)
Discussion started by: johnkim0806
6 Replies

7. Shell Programming and Scripting

How to print excel file / csv file in solaris server ?

Hi, I have to print a excel file in solaris server. I am using lexmark printer with post script printer driver . But the problem is when i am using " lp -d <printer name> <somefile name.xls>" command it is not printing correctly. but for pdf file using the same command it printing correctly. ... (2 Replies)
Discussion started by: Sambuddha
2 Replies

8. UNIX for Advanced & Expert Users

Problem in converting password protected excel file to csv file in unix

I need to convert a password protected excel file which will be in UNIX server to a comma separated file. For this I need to open the excel file in UNIX box but the UNIX box doesn't prompt for password instead it is opened in an encrypted manner. I could manually ftp the excel file to local... (2 Replies)
Discussion started by: Devivish
2 Replies

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