in reply to Re: Removing Carriage returns from text files
in thread Removing Carriage returns from text files

That doesn't seem to work as when I run that on the file and then view it in UtraEdit's Hex mode chr(13) seems to be 0D which as far as I can tell is the offending character. So I tried chr(10) instead and it returns 0D 0A. When I was testing this in vb I found that I need to remove 0D and keep 0A. I tried s/\x0D//g but that didn't work, I tried s/\n/\012/g ditto. I tried all the possibilities but as far as I can tell in Windows \n means CR&LF no matter what you try.
Am I totally off base here?
Thanks again.
Kalimeister

Replies are listed 'Best First'.
Re: Re: Re: Removing Carriage returns from text files
by Elliott (Pilgrim) on Oct 18, 2001 at 03:05 UTC
    Yeah - that does make sense :-(

    On MacPerl \n gets converted to \r on the fly - and the equivalent on a PC would be \r\n.

    I tried - but I'm out of ideas. Sorry.

Re: Re: Re: Removing Carriage returns from text files
by Dr. Mu (Hermit) on Oct 18, 2001 at 06:42 UTC
    Well, if you've got UltraEdit, your problem is solved! Just open the file, select File->Conversions->Dos to Unix, and you're done.

    If you were looking for an automated way to do a bunch of files, please disregard this note...

Re: Re: Re: Removing Carriage returns from text files
by Biker (Priest) on Oct 19, 2001 at 11:06 UTC

    Are you sure your problem is within the file?

    UltraEdit is by default configured to 'Autodetect Unix files' and to 'Auto convert Unix files'.

    If this is happening, then your UltraEdit will pick up your correctly formatted file (with LF's only) and change all LF's to LF-CR's before showing it to you. When you use Ctrl-H to see it in hex, it is already converted back to DOS mode.

    Check Advanced-Configuration-General in your UltraEdit.

    f--k the world!!!!
    /dev/world has reached maximal mount count, check forced.