I need to replace all the CR(\r) LF(\n) characters (0d 0a in hex) with only LF in a text file ON WINDOWS. In other words, I want to convert a Windows text file to a Unix text file format using Perl...BUT from a Window system, NOT a UNIX system. Simply trying to replace the CR in a substitution string doesn't work. Windows seems to be working against me in that it always puts the CR back with the LF when I do a replace and write the file. A substitution like s/\s+$/\n/; does work, but removes too much because it also removes the LF characters, which I need. I found a few related solutions poking around the Web, but unfortunately, they were intended for execution on UNIX (for example, perl -p -e 's/\r$//' < winfile.txt > unixfile.txt ). Does anyone know of a Windows code solution, or will I need to do something more drastic like edit the binary?
Thanks in advance for any assistance. -- New Group member