Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Search Forums:



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

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 12-17-2009
Registered User
 

Join Date: Dec 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Inserting control characters at the end of each line

How to add control characters at the end of each line in a file?

Can anyone help me with this?

Thanks,
Shobana
Sponsored Links
    #2  
Old 12-17-2009
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 8,511
Thanks: 67
Thanked 403 Times in 392 Posts
If this has to to with the ^M post earlier:
^M is the return key which in script is: \r
one way to do this:

Code:
while read record
do
    echo "$record \r"
done < oldfile > newfile

Sponsored Links
    #3  
Old 12-17-2009
Ghostdog (Read Only)
 

Join Date: Dec 2009
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts

Code:
dos2unix file file
unix2dos file file

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
Inserting a line before the line which matches the patter laxmi131 UNIX for Advanced & Expert Users 10 12-18-2008 06:31 AM
vi : inserting non-printing characters cstovall Shell Programming and Scripting 2 08-29-2005 04:55 PM
inserting characters before each line... Nicol Shell Programming and Scripting 4 09-02-2004 04:40 AM
Remove control characters aravind_mg UNIX for Dummies Questions & Answers 5 10-02-2002 01:07 PM
getting rid of control characters apalex UNIX for Dummies Questions & Answers 2 07-12-2001 02:12 AM



All times are GMT -4. The time now is 03:18 AM.