Skip to content

--rs/--ors not being respected with --csv/--ocsv? #1810

@manselmi

Description

@manselmi

Issue

Miller doesn't seem to be respecting the --rs or --ors options in conjunction with the --csv or --ocsv flags.

More specifically, if I provide Miller a CSV with \r\n record terminators, request CSV output format with either --csv or --ocsv and request the output have \r\n record terminators with either --rs '\r\n' or --ors '\r\n', then Miller should output a CSV with \r\n record terminators. On macOS the output has \n record terminators.

I feel like I'm missing something obvious.

Expected output

% printf '%s\r\n' data | mlr --csv --rs '\r\n' --hi --ho cat | od -v -A d -t cx1
0000000    d   a   t   a  \r  \n
           64  61  74  61  0d  0a
0000006

Actual output

% printf '%s\r\n' data | mlr --csv --rs '\r\n' --hi --ho cat | od -v -A d -t cx1
0000000    d   a   t   a  \n
           64  61  74  61  0a
0000005

Environment details

Miller version:

% mlr --version
mlr 6.13.0

macOS version:

% sw_vers
ProductName:            macOS
ProductVersion:         15.5
BuildVersion:           24F74

CPU architecture:

% uname -p
arm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions