in reply to Changing CRLF in Windows to LF for UNIX
> 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
|
---|
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 |