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
.xls to .csv conversion neil546 Shell Programming and Scripting 7 07-17-2007 12:55 AM
Hex Conversion insania Shell Programming and Scripting 2 03-20-2007 11:15 AM
conversion rajan_ka1 UNIX for Advanced & Expert Users 1 03-14-2006 03:56 AM
String Conversion in awk rohanrege Shell Programming and Scripting 3 02-14-2005 01:05 PM
X.25 to TCP/IP conversion manjunath IP Networking 2 08-20-2002 05:57 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-01-2008
Registered User
 

Join Date: Nov 2007
Posts: 52
conversion

hi all
i have a file like

151125
25252
2452567
253464576
255

i want this file to be like

'151125','25252','2452567','253464576','255'

please help

thanks
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 06-01-2008
jaduks's Avatar
Registered User
 

Join Date: Aug 2007
Location: Assam,India
Posts: 141
Code:
$ echo `< infy.txt tr '\n' ',' | sed "s/[0-9]*/\'&\'/g; s/,''$// "`
//Jadu
Reply With Quote
  #3 (permalink)  
Old 06-01-2008
Registered User
 

Join Date: May 2008
Posts: 7
Not sure if it is...

#!/bin/sh
for i in `cat file10`
do
echo \'$i\',
done | fmt
Reply With Quote
  #4 (permalink)  
Old 06-01-2008
Registered User
 

Join Date: Nov 2007
Posts: 52
Quote:
Originally Posted by jaduks View Post
Code:
$ echo `< infy.txt tr '\n' ',' | sed "s/[0-9]*/\'&\'/g; s/,''$// "`
//Jadu
great!!!!

cheers
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:16 AM.


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

Content Relevant URLs by vBSEO 3.2.0