#407 Gawk 3.1.6 changes CR-LF line ending to LF

Gawk
closed
GnuWin
Binaries (396)
5
2012-07-26
2008-01-07
npocmu
No

Gawk 3.1.4 not changes CR-LF line ending
Gawk 3.1.6 changes CR-LF line ending to LF only

Example:
gawk {print} file_with_crlf.txt > file_with_lf.txt

This changes break compatibility with many other windows-specific software that allow only files with standard CR-LF line ending.

I'm migrate from GygWin to GnuWin32 some time ago, because GygWin updates do changes CR-LF support for different tools in a "random" way.

Does GnuWin32 go on the same way?

Discussion

  • GnuWin

    GnuWin - 2008-01-07

    Logged In: YES
    user_id=217802
    Originator: NO

    No, this will be fixed in a next release. In the meantime, add the option

    -v BINMODE=0

    to the command line for the old behavior.
    By the way, which "many other windows-specific software ... allow only files with standard CR-LF line ending"? As far as I know, most windows-specific software allows both CRLF and LF, notepad being the only exception.

     
  • npocmu

    npocmu - 2008-01-14

    Logged In: YES
    user_id=1700330
    Originator: YES

    "As far as I know, most windows-specific software allows both CRLF and LF, notepad being the only exception."

    I have not time to explicit testing all windows software :-). But there some examples:

    1) bcp - the bulk copy utility from MS SQL Server. That utility has special switch -r for specify row terminator. Therefore when I loading old files prepared with gawk 3.1.4. I need for one command line. After upgrade to gawk 3.1.6 - other command line. My tool chain can properly load only some files depending on gawk version as result . As solution I must add some additional logic to the tool chain for detect line ending or explicitly convert each file (50-500Mb size) to standard line ending before invoking the bcp utility.

    2) eNetworks Personal Communication application v4.3 can't properly transfer files with LF only line ending.

    This is critical incompatibilities (but I'm sure no last) and I'm stop testing and downgrade to previous gawk version.

    PLEASE! NEVER change source file line ending without an explicit user request (via command line switch, environment variable or anything other way)

     
  • Thomas H. Schmidt

    Logged In: YES
    user_id=1983946
    Originator: NO

    I would like to agree to npocmu to remove the critical incompatibilities from Gawk 3.1.6 regarding CRLF vs. LF.
    I fully agree when you say "...As far as I know, most windows-specific software allows both CRLF and LF, notepad being the only exception..." - most windows-specific software is able to work with both CRLF and LF. But Gawk 3.1.6 creates output files that have only LF instead of CRLF as usual in windows (if you use the same script file and the same settings as for Gawk 3.1.5. And if you are going to use these output files for some special purposes you will need the same behaviour (and the CRLF) as before.
    Our problem with Gawk 3.1.6 is that it handles CRLF not according to standard windows rules in its default setting (i.e. BINMODE=2), and worse, it handles CRLF differently then Gawk 3.1.5.
    I would like to state that it makes much more sense to use BINMODE=0 as default for the Win32 version.

     
  • GnuWin

    GnuWin - 2008-02-17

    Logged In: YES
    user_id=217802
    Originator: NO

    This bug has been fixed. A new release is available through
    http://gnuwin32.sourceforge.net/

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks