• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

soft returns

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

macklin01

Computational Oncologist / Biomathematician / Mode
Joined
Apr 3, 2002
Location
Bloomington, IN
Hello!

I'd like to write a small utility for replacing "soft returns" with "hard returns". I see these a lot when I transmit text files from linux to windows, and it would be nice to be able to just filter the files through a small proggy.

In essence, all I need are the ascii codes (probably in octal) for the two types of returns. Can anybody help?

For example, the "@" symbol is number 64, which is 100 in octal, and coded as \100.

Thanks! -- Paul
 

XWRed1

Senior Member
Joined
Oct 31, 2001
In dos/windows systems, they use a cr and an lf which is 13 and 10 in decimal, or 0D and 0A in hex. Linux/Unix machines just use an lf for newlines.

Course there's already a million scripts and utilities for converting between these.
 
OP
macklin01

macklin01

Computational Oncologist / Biomathematician / Mode
Joined
Apr 3, 2002
Location
Bloomington, IN
Thanks! One last question: CR is a hard return, and LF is a soft return, right?

Often, linux sticks in LF when you hit return within a paragraph (as in editing code, for instance) that is interpretted strangely in windows notepad, for instance. (Or do I have this backwards?)

Thanks! -- Paul
 
OP
macklin01

macklin01

Computational Oncologist / Biomathematician / Mode
Joined
Apr 3, 2002
Location
Bloomington, IN
XW, once again, thanks. Against all proper advice, I wrote my grep and tail/head anyway. I've found it pretty handy in monitoring my console folding. (I don't like the screensavers, EMIII, etc.)

Thanks again for your help, as well as from Thelemac. You were just the two I was hoping would help! :) -- paul