The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
To remove carriage return between the line shash UNIX for Dummies Questions & Answers 5 07-31-2007 09:12 AM
Carriage Return at end of file bd_joy Shell Programming and Scripting 14 10-20-2006 10:20 AM
Removing Carriage Return and or line feed from a file tbone231 Shell Programming and Scripting 1 02-18-2005 01:37 PM
carriage return/line feeds pitstop Shell Programming and Scripting 4 11-24-2003 12:47 PM
Regex to pick up name from the following including carriage return at end of the line Shakey21 Shell Programming and Scripting 3 07-18-2002 05:27 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 08-05-2005
Registered User
 

Join Date: Aug 2005
Posts: 1
Question How to insert carriage return before line feed?

I am doing some edi where translations had to be run on unix. Generally when I run the translations on windows, the output file has both carriage returns and line feed where as when ran on unix will have only line feed. I need to insert carriage return before the line feed. Is there some tool that or script that I can use to do this?
Reply With Quote
Forum Sponsor
  #2  
Old 08-05-2005
Ygor's Avatar
Moderator
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,249
You can use either unix2dos or something similar, depending on your system.
Reply With Quote
  #3  
Old 08-05-2005
vertigo23's Avatar
Registered User
 

Join Date: Jul 2005
Location: SF, CA
Posts: 67
Here ya go

If you're doing your editing in vi, you can :set ff=dos

if you need to batch process a bunch of files, you can do this:
Code:
perl -i -pe 's/$/\r/' <file> <another file>
or, for a whole directory...

Code:
perl -i -pe 's/$/\r/' `/bin/ls`

There's probably a way of doing that with sed also, but I'm new-skool

Last edited by vertigo23; 08-05-2005 at 10:34 AM.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:51 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0