The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
exporting number into .csv file in text form (no other extra charc) from shell script Deepak_Rastogi Shell Programming and Scripting 5 03-13-2008 01:08 PM
Extracting data from text file based on configuration set in config file suparnbector Shell Programming and Scripting 3 08-09-2007 11:25 PM
How to extract data from a text file negixx Shell Programming and Scripting 1 07-19-2005 06:30 PM
Exporting data clearchoice Windows & DOS: Issues & Discussions 0 06-16-2005 10:32 AM
getting data out from a text file skotapal Shell Programming and Scripting 7 09-14-2002 08:10 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 09-16-2005
Registered User
 

Join Date: Sep 2005
Posts: 2
Exporting text file data to csv

Could any one help me in basic shell script to export text file data to csv.
I need to export only particular data from text file to csv column.
I am a newbie to UNIX could anyone help me with sample script code
Reply With Quote
Forum Sponsor
  #2  
Old 09-16-2005
RishiPahuja's Avatar
Registered User
 

Join Date: Apr 2005
Location: Bangalore, India
Posts: 203
Thumbs up

post some extract from your data file and the way you wish to see the output.
Reply With Quote
  #3  
Old 09-16-2005
Registered User
 

Join Date: Sep 2005
Posts: 2
elapsed = 76.38 seconds, average = 0.352 seconds, minimum = 0.159 elapsed = 379.005 seconds, average = 0.379 seconds, minimum = 0.157 elapsed = 683.99 seconds, average = 0.455 seconds, minimum = 0.156 elapsed = 1043.271 seconds, average = 0.521 seconds, minimum = 0.154 elapsed = 1408.594 seconds, average = 0.563 seconds, minimum = 0.154


i need to export this data to csv like
elapsed average minimum

176.38 0.352 0.159
x.aaa y.aaaa z.aaaa
x.aaa y.aaaa z.aaaa
x.aaa y.aaaa z.aaaa
x.aaa y.aaaa z.aaaa
Reply With Quote
  #4  
Old 09-18-2005
Ygor's Avatar
Moderator
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,249
Try...
Code:
#!/usr/bin/bash
set $(<file1)
while [[ $# -gt 0 ]]
do
  echo $3,$7,${11}
  shift 11
done
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:50 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0