in reply to Changing CRLF in Windows to LF for UNIX

Hello mabowden and welcome to the monastery and to the wonderful world of Perl!

> one liners havent worked..

strange: they always work! see The ultimate guide to Windows and Unix file line ending conversion in Perl by David Farrell

(On windows) By default Perl changes the value of “\n” to CRLF. This m +eans that the regex match: “/\015\012/” will fail on Windows as Perl +is actually running: “/\015\015\012/“. Regexes using meta-characters +and hex codes (”/\r\n/” and “/\x0d\x0a/“) fail for the same reason. ... perl -pe "binmode(STDOUT);s/\R/\012/" /path/to/file > /path/to/new/fil +e

L*

PS see also newline gory details by afoken

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: Changing CRLF in Windows to LF for UNIX
by mabowden (Novice) on Oct 30, 2018 at 21:03 UTC
    I'm quite sure that it "worked" in the sense of doing what I told it to do, but didn't work in the sense that I didn't get the expected output ...