The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
converting fixed length file to delimited file Nishithinfy Shell Programming and Scripting 2 07-02-2009 08:50 AM
Problem in converting password protected excel file to csv file in unix Devivish UNIX for Advanced & Expert Users 2 03-30-2009 08:56 PM
converting a .txt file to comma delimeted file OSD UNIX for Advanced & Expert Users 1 09-16-2008 04:52 AM
Converting a Delimited File to Fixed width file raghavan.aero Shell Programming and Scripting 2 06-06-2007 03:44 PM
Converting Pivot file to flat file vskr72 Shell Programming and Scripting 2 10-18-2005 05:41 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-10-2009
krthkmuthu krthkmuthu is offline
Registered User
  
 

Join Date: Sep 2009
Posts: 1
Unhappy 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 (permalink)  
Old 09-10-2009
Franklin52 Franklin52 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,312
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..
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:20 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0