LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-02-2009, 02:36 AM   #1
ibabhelix
Member
 
Registered: Sep 2009
Posts: 51

Rep: Reputation: 18
appending to file, or editing a file


i have a file

Code:
C4'   G A   1	    
P     G A   2	
P     G A   2	
C4'   G A   1	
P     G A   2	
P     G A   2	                           
C4'   G A   1	
P     G A   2	
P     G A   2
at the end of each line i wanna add "......" that is the file must look like this :

Code:
P     G A   2....	
P     G A   2....	
C4'   G A   1....	
P     G A   2....	
P     G A   2....	                           
C4'   G A   1....	
P     G A   2....	
P     G A   2....
how do i do this ?
what command should i use ?
please help me
 
Old 11-02-2009, 02:48 AM   #2
vijay_babu1981
Member
 
Registered: Nov 2004
Location: india
Distribution: fedora 10
Posts: 82

Rep: Reputation: 19
This should work
sed 's/$/..../' INFILE > OUTFILE
 
Old 11-02-2009, 03:27 AM   #3
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
you have been exposed to shell scripting in your previous posts and its an easy task for this stated problem. Try to do it yourself and show your code next time.
 
Old 11-02-2009, 06:57 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
@ibabhelix;

What reference material are you using for learning shell scripting? Has anyone suggested http://tldp.org? If not, go there and get the Bash Guide for Beginners.
 
Old 11-02-2009, 07:23 AM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

You might want to start with the 'Bash Beginners Guide'.

 
Old 11-02-2009, 07:37 AM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Is there an echo in here?
 
Old 11-02-2009, 07:54 AM   #7
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
another Beginner guide
 
Old 11-02-2009, 06:11 PM   #8
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

Quote:
Originally Posted by pixellany View Post
Is there an echo in here?
Sorry,,,Sorry,,,Sorry!

I did not see your post. I copied the wrong link anyway, It should have been; Advanced Bash-Scripting Guide 6.1.




The above link and others can be found at 'Slackware-Links'. More than just SlackwareŽ links!
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Appending a string to columns in a file raghu123 Programming 2 08-29-2008 01:19 AM
Appending to a log file (C++) itz2000 Programming 4 10-27-2006 09:57 AM
appending a file circuit_girl Programming 8 10-01-2006 11:00 AM
Appending a string to a file JStew Linux - General 13 03-04-2003 03:48 PM
sending a mail appending a file saavik Linux - Newbie 4 07-12-2002 03:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration