0

I am doing a project in my office.

Concept: Write a unix shell script to fetch data from oracle db and write to excel file and send it in email.

I written a shell script which fetch 4 set of data from database in html table format (using isql) in 4 files. Files are saved with suffix .xls. So when it is opened in windows, it will be opened with excel. Now my problem is all the 4 excel files should be combined to single excel with 4 tabs.

I know this can be done using Python and Perl but python and perl are not allowed for the project.

Since the files are in html table format, is there any way to combine using html or please prefer any other idea.

Jayavinoth
  • 494
  • 1
  • 8
  • 19

2 Answers2

0

From UNIX command line: cat file1 file2 file3 file4 >> file5

Ronak Patel
  • 3,634
  • 1
  • 14
  • 26
0

Hi vinoth you can use the oracle spool command to fetch the file from oracle and save into csv or xls file. Dont use the isql command just use simple sqlplus.I will share the code sample.

Ajinkya
  • 83
  • 9
  • using spool command only i fetch the data into .xls file with isql command. If I use sqlplus command, will it satisfy my expectation. – Jayavinoth May 20 '16 at 04:55
  • @vinoth you can create 4 excel the file in csv or .xls using spool command and create the macro in excel to import other three sheet into it.This might be one way use can try. – Ajinkya May 20 '16 at 10:58