appending a command to print a file in a comma delimited format | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

appending a command to print a file in a comma delimited format

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 10-10-2012
prodigy06 prodigy06 is offline
Registered User
 
Join Date: Oct 2012
Last Activity: 30 July 2014, 3:05 AM EDT
Posts: 20
Thanks: 8
Thanked 0 Times in 0 Posts
appending a command to print a file in a comma delimited format

Hi everyone,

i have a file that I had grep'd from something else lets call it file1.txt which consists variable files and lines due to different scenarios/inputs

Code:
1782
9182
fe35
ac67

how can I print this in this manner?

Code:
1782,9182,fe35,ac67

also if i had piped the new output to a file say file2.txt, how can i call file2.txt using printf? please help. thanks a lot.
Sponsored Links
    #2  
Old 10-10-2012
elixir_sinari's Avatar
elixir_sinari elixir_sinari is offline Forum Advisor  
Registered User
 
Join Date: Mar 2012
Last Activity: 9 October 2014, 4:50 PM EDT
Location: India
Posts: 1,412
Thanks: 101
Thanked 496 Times in 473 Posts
Have a look at the man page for paste .
Sponsored Links
    #3  
Old 10-10-2012
bmk bmk is offline
Registered User
 
Join Date: Dec 2011
Last Activity: 31 October 2013, 9:16 AM EDT
Posts: 262
Thanks: 1
Thanked 22 Times in 22 Posts
Try like..

Code:
paste -d , -s test1.txt

Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Print records which do not have expected number of fields in a comma delimited file machomaddy Shell Programming and Scripting 7 01-31-2012 08:27 AM
Remote command output to file comma delimited markdjones82 Shell Programming and Scripting 0 06-10-2010 09:57 AM
Urgent! need help! how to convert this file into comma delimited format natalie23 UNIX for Advanced & Expert Users 2 08-28-2009 04:39 AM
how to convert this file into comma delimited format natalie23 Shell Programming and Scripting 1 08-28-2009 04:25 AM
Converting Tab delimited file to Comma delimited file in Unix charan81 Shell Programming and Scripting 22 01-20-2006 08:24 AM



All times are GMT -4. The time now is 11:17 PM.