Converting .csv file into .xls file and send it to inbox


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Converting .csv file into .xls file and send it to inbox
# 1  
Old 09-10-2009
Data Converting .csv file into .xls file and send it to inbox

Hi All,

I wrote a script to extract data from Oracle DB and place it in a text file , and I have coverted .txt file into comma seperated .csv file and I sent it to my mail box .

I can get .xls file in my inbox.I am getting all data in same column and in different rows , without column name.

but my requirement is to get data in different cells with column names.

I am using, ( uuencode /test.csv /test.xls |mailx -s "test mial" abscd@in.ab.com ) to send the file.

Note : In my script I set heading off because , every 10 records once I am getting the headings , I don't want like that I need the headings to be printed once .

I want to setup a cron which does all these conversions and send a full completed excel sheet to my inbox.

Please someone guide me.

Regards,
Karthi

Example files:

my .txt file looks like,

asmdev1 karthi
asmdev2 ganesh

my .csv file looks like ,

asmdev1,karthi
asmdev2,karthi

I want to get asmdev in one column and karthi in second column with heading's .
# 2  
Old 09-10-2009
You can use the tr command to replace the spaces with commas, check the man page of tr.
Another way is to use the "Text to Columns Feature" of Excel.

Regards

Last edited by Franklin52; 09-10-2009 at 10:20 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Converting xls file to xlsx on UNIX script / command line.

Hi All, Am needing advise on how to convert xls file to xlsx format on Solaris unix command line or scripting. I tried searching online but it looks like I need to either use Perl packages of Excel or Python packages or some other 3rd party tool. Problem is to install any of these will require... (2 Replies)
Discussion started by: arvindshukla81
2 Replies

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

3. Shell Programming and Scripting

How to convert a xls file to csv?

Hi, My requirement is to convert the xls to csv file with utf-8 conversion. Is there any way please suggest me. Thanks, Raja (4 Replies)
Discussion started by: cnraja
4 Replies

4. Shell Programming and Scripting

Converting .xls into .csv and find & Replace

Hi All, Please give me the solution to the following ASAP. 1) Converting the .xls into .csv Script i tried, mv hello.xls hello.csv The above given script converting the .xls file into .csv successfully. But after i run the below unix command I am no able to open the .csv file, its giving... (4 Replies)
Discussion started by: velava
4 Replies

5. AIX

How to convert csv file to xls file

Hi All, I have a java program running in AIX machine which gives me the output in form of .CSV but my clients wants output in the form of .xls When I gave the command mv <filename.csv> <filename.xls> The contents of this .xls file is not exactly in seprate columns as in CSV, the contents... (1 Reply)
Discussion started by: chetu777
1 Replies

6. Shell Programming and Scripting

Conversion of .xls file to .csv file

Hi Folks, I've to convert manually couple of *.xls files to *.csv files everyday :( so i was just wondering if anyone could just help me with a shell script or awk script to automate the process :) PS : Problem is that i cannot use any third party software for the conversion. Thanking... (1 Reply)
Discussion started by: chaturvedi
1 Replies

7. Shell Programming and Scripting

converting xls file to txt file and xls to csv

I need to convert an excel file into a text file and an excel file into a CSV file.. any code to do that is appreciated thanks (6 Replies)
Discussion started by: bandar007
6 Replies

8. Shell Programming and Scripting

From xls to csv file

Can we convert an xls file into csv format in Unix Thanks Suresh (1 Reply)
Discussion started by: sureshg_sampat
1 Replies

9. Shell Programming and Scripting

Converting csv to xls

Hi, Can anyone tell the option to change the file type in unix. i.e. if a file is in csv(Comma Separating Values) format, it should be changed to xls(ordinary MS-Excel) format. But renaming command is not changing to correct file format. Thanks in advance, Milton. (1 Reply)
Discussion started by: miltony
1 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