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
Joining lines in reverse. append line 1 to line 2. dwalley Shell Programming and Scripting 7 08-04-2008 08:11 AM
Search a string and append text after the string kesu2k Shell Programming and Scripting 8 07-18-2008 08:35 PM
How to append some strings line by line? xinoo Shell Programming and Scripting 4 06-24-2008 03:04 AM
Append string in all rows Rock Shell Programming and Scripting 7 12-01-2006 02:46 AM
append esc string beilstwh Shell Programming and Scripting 2 05-11-2005 02:33 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-15-2008
bggibson bggibson is offline
Registered User
  
 

Join Date: Aug 2008
Location: Roanoke, VA
Posts: 4
HOWTO Append String to End of Line

I have a comma delimited text file and need to appened ",000000" to the end of every line. For example:

Before:
"D700000","2006" ,"5000","Open Year" ,"Conversion" ,"Wk64","Productive Payroll $" ,1103.45

After:
"D700000","2006" ,"5000","Open Year" ,"Conversion" ,"Wk64","Productive Payroll $" ,1103.45,"000000"

Thank you in advance for your help.

Brian
  #2 (permalink)  
Old 08-15-2008
shamrock shamrock is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2007
Location: USA
Posts: 753
Code:
awk '{printf "%s,\"%s\"\n",$0,"000000"}' file
  #3 (permalink)  
Old 08-15-2008
Franklin52 Franklin52 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,322
Another approaches:

Code:
sed 's/.*/&,000000/' file
or:

Code:
awk '{print $0,",000000"}' file
  #4 (permalink)  
Old 08-15-2008
bggibson bggibson is offline
Registered User
  
 

Join Date: Aug 2008
Location: Roanoke, VA
Posts: 4
Thank you.
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 10:46 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