Page 1 of 1

line feed charachters VS carriage returns

Posted: Tue Aug 19, 2003 7:18 pm
by rogerripa
Hello all. I'm trying to put together a special file to be sent out and this is the response I got back from the company who is trying to use my file:

"The file contains carriage returns and line feed characters at the end of
each line. Please correct this so only line feed characters are at the end
of each line."

Is there a difference between the two? I am totally baffled and am looking for a tool to purchase that can handle this request on a regular basis. Any help would be greatly appreciated. Is their request even doable?

Please help!!!

Posted: Tue Aug 19, 2003 7:53 pm
by webmasta
you're in luck..
Is there a difference between the two?
CR/LF is what bright spark BillG decided to put at the end of each line to denote a newline in DOS.
On a UNIX station, (which is probably what your clients are using) it just uses a newline character (\n)

EDIT : Found the link to the original sofware...
http://www.speedsoft.com/cgicentral/fixcrlf.html
ftp://ftp.speedsoft.com/pub/speedsoft/fixcrlf.exe

Excellent suggestions below but in case you dont want to save ure file with the converted endings, just send this utility to ure clients and be done with that hassel.

Posted: Tue Aug 19, 2003 8:01 pm
by talleyrand
Welcome to the difference between Mac, Unix and Dos based applications! I hope you enjoy your journey. Mac's use Carriage Return {ASCII 13} as their end of line operator, Unix uses line feeds {ASCII 10} and Windows uses a combination of CR and LF. So, what to do, what to do? The choices are boundless.
a) You can use TP and use Save As and there set your File Format to Unix, Mac or Windows. Unix is what you'd be looking for in this case
b) Use a handy dandy regexp to replace the CR with nothing
c) Have the file recipient run it through dos2unix
d) Install cygwin or simply google dos2unix.exe
e) ftp the file to them in ascii mode

I can probably come up with half a hundred other solutions if you need but I suspect one of the aforementioned will work just fine. Buy Textpad, it's great. I've been using it ever since I switched over from vi and VIM three years ago and I still find handy features I had never even realized I needed.

Oh and if you have money burning a hold in your pocket, you can pay me. ;) The dos2unix program is free and easy to use. dos2unix myfile1 myfile2 myfile3... Changes are done in place.

Posted: Tue Aug 19, 2003 8:16 pm
by bbadmin
If you open the file in TextPad, then use its Save As command, you can choose which line endings to use from the drop-down list of File Formats. Choose Unix, if you only want linefeeds.

Keith MacDonald
Helios Software Solutions

Posted: Tue Aug 19, 2003 9:20 pm
by rogerripa
Thanks everybody for the quick response. Those were all great suggestions. Sounds like I have a lot of options to choose from here. Can't believe I didn't come up with at least one of them. Well I got Tp so that was a good start anyway. Thanks again everyone.