The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Append text at end of the first line in a file catgovind Shell Programming and Scripting 7 05-01-2008 08:33 AM
append a line to the last line in a file subhrap.das UNIX Desktop for Dummies Questions & Answers 5 04-25-2007 10:17 AM
how to append text into a file. beilstwh Shell Programming and Scripting 2 03-06-2007 05:51 PM
append line ymeyaw UNIX for Dummies Questions & Answers 7 04-09-2006 11:14 PM
Text Append 801238429 Shell Programming and Scripting 5 04-05-2005 01:59 PM

Closed Thread
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 08-29-2005
Redg Redg is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 10
using sed to append text to the end of each line

Anyone know how to use SED to append a comma to the end of each line

example:

field1,field2,field3,field4

If i Cat /textfile ---- How can i append the end of /textfile with a comman?
  #2 (permalink)  
Old 08-29-2005
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,131

Code:
echo 'a,b,c' | sed 's/$/,/'

  #3 (permalink)  
Old 08-29-2005
Redg Redg is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 10
Works Great...Thanks for your help
  #4 (permalink)  
Old 07-11-2006
gfhgfnhhn gfhgfnhhn is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 77
can u explain the syntax a little bit
about 'a,b,c' part
  #5 (permalink)  
Old 07-11-2006
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
Quote:
Originally Posted by gfhgfnhhn
can u explain the syntax a little bit
about 'a,b,c' part
a,b,c is just a placeholder. It can be anything; wrt the OP, it is the same as
field1,field2,field3,field4
  #6 (permalink)  
Old 07-11-2006
madhunk madhunk is offline
Registered User
  
 

Join Date: Nov 2005
Posts: 91
I am not sure if I have to start another thread or request for an answer in the same thread..

Just wondering how we can append tabs at the end of each line...
Data:
field1, field2, field3, field4
1 2
3 4 5

Append tab on field3 and field4 for the first row..and
Append tab on field4 for the second row.

Please advise...
Madhu
Closed Thread

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 01:29 AM.


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