in reply to automatic endlines when saving txt file under windows?

Traditional UNIX endlines are \n. In Windows, they are \r\n. You may need to tack on the \r\n for notepad to see them correctly (Wordpad always behaves as it should, seeing the \n as meaning a new line). Even if you open them up in Wordpad and save them again, they will not modify the newlines. There are some flukes with getting notepad to read UNIX newlined text files. Sometimes it will appear overlapped, othertimes you might see boxes. If you save something with a .wri extension, wordpad will be (by default) associated with it for opening because it's the old Windows Write extention. Hope that helps

    --jb
  • Comment on Re: automatic endlines when saving txt file under windows?

Replies are listed 'Best First'.
Re: Re: automatic endlines when saving txt file under windows?
by emilford (Friar) on Jun 06, 2002 at 20:20 UTC
    Thanks for the information. I tried adding the \r\n in place of just \n, but that didn't work either. I'm not really concerned with how the information looks when I open it in Notepad, I just want the program to interact with the files correctly. Shouldn't Perl recongnize the \n as endlines even though Notepad doesn't?