diff --git a/c/cli/mlrcli.c b/c/cli/mlrcli.c index 5f414ed35..acd65f9b8 100644 --- a/c/cli/mlrcli.c +++ b/c/cli/mlrcli.c @@ -114,8 +114,6 @@ lhmss_t* get_default_rses() { char* env_default = getenv("MLR_CSV_DEFAULT_RS"); if (env_default != NULL && !streq(env_default, "")) csv_rs = cli_sep_from_arg(env_default); - else - lhmss_put(singleton_default_rses, "csv", "\r\n", NO_FREE); lhmss_put(singleton_default_rses, "csv", csv_rs, NO_FREE); lhmss_put(singleton_default_rses, "csvlite", "\n", NO_FREE); @@ -297,8 +295,8 @@ static void main_usage_data_format_examples(FILE* o, char* argv0) { fprintf(o, " DKVP: delimited key-value pairs (Miller default format)\n" " +---------------------+\n" - " | apple=1,bat=2,cog=3 | Record 1: \"apple\" => \"1\", \"bat\" => \"2\", \"cog\" => \"3\"\n" - " | dish=7,egg=8,flint | Record 2: \"dish\" => \"7\", \"egg\" => \"8\", \"3\" => \"flint\"\n" + " | apple=1,bat=2,cog=3 | Record 1: \"apple\" => \"1\", \"bat\" => \"2\", \"cog\" => \"3\"\n" + " | dish=7,egg=8,flint | Record 2: \"dish\" => \"7\", \"egg\" => \"8\", \"3\" => \"flint\"\n" " +---------------------+\n" "\n" " NIDX: implicitly numerically indexed (Unix-toolkit style)\n" @@ -345,7 +343,15 @@ static void main_usage_data_format_examples(FILE* o, char* argv0) { " | |\n" " | dish 7 | Record 2: \"dish\" => \"7\", \"egg\" => \"8\"\n" " | egg 8 |\n" - " +---------------------+\n"); + " +---------------------+\n" + "\n" + " Markdown tabular (supported for output only):\n" + " +-----------------------+\n" + " | | apple | bat | cog | |\n" + " | | --- | --- | --- | |\n" + " | | 1 | 2 | 3 | | Record 1: \"apple => \"1\", \"bat\" => \"2\", \"cog\" => \"3\"\n" + " | | 4 | 5 | 6 | | Record 2: \"apple\" => \"4\", \"bat\" => \"5\", \"cog\" => \"6\"\n" + " +-----------------------+\n"); } static void main_usage_data_format_options(FILE* o, char* argv0) { diff --git a/c/reg_test/run b/c/reg_test/run index 18946222a..588959550 100755 --- a/c/reg_test/run +++ b/c/reg_test/run @@ -2,6 +2,7 @@ # ================================================================ set -e +export MLR_CSV_DEFAULT_RS= # In case set in user's shell # For building with autoconf: # * in-directory build: diff --git a/c/todo.txt b/c/todo.txt index 10eb1481b..8f162fc00 100644 --- a/c/todo.txt +++ b/c/todo.txt @@ -16,12 +16,6 @@ TOP OF LIST: - my bashrc x 2 - clear @ top of regtest -* markdown format - - mld - ? input - k output - k UT - * cookbook: - neaten-valgrind - headerless csv (i/o) choices @@ -51,6 +45,7 @@ TOP OF LIST: - new/modified cookbook entries ---------------------------------------------------------------- +? --imd? ? double-quote-aware (non-lite) nidx & dkvp options? ? comma-number -- using locale? diff --git a/doc/file-formats.html b/doc/file-formats.html index 62cc7a9f7..40fb228c9 100644 --- a/doc/file-formats.html +++ b/doc/file-formats.html @@ -162,8 +162,8 @@ Miller commands were run with pretty-print-tabular output format. $ mlr --usage-data-format-examples DKVP: delimited key-value pairs (Miller default format) +---------------------+ - | apple=1,bat=2,cog=3 | Record 1: "apple" => "1", "bat" => "2", "cog" => "3" - | dish=7,egg=8,flint | Record 2: "dish" => "7", "egg" => "8", "3" => "flint" + | apple=1,bat=2,cog=3 | Record 1: "apple" => "1", "bat" => "2", "cog" => "3" + | dish=7,egg=8,flint | Record 2: "dish" => "7", "egg" => "8", "3" => "flint" +---------------------+ NIDX: implicitly numerically indexed (Unix-toolkit style) @@ -211,6 +211,14 @@ $ mlr --usage-data-format-examples | dish 7 | Record 2: "dish" => "7", "egg" => "8" | egg 8 | +---------------------+ + + Markdown tabular (supported for output only): + +-----------------------+ + | | apple | bat | cog | | + | | --- | --- | --- | | + | | 1 | 2 | 3 | | Record 1: "apple => "1", "bat" => "2", "cog" => "3" + | | 4 | 5 | 6 | | Record 2: "apple" => "4", "bat" => "5", "cog" => "6" + +-----------------------+
diff --git a/doc/mlr.1 b/doc/mlr.1 index f5d110d5b..28e96c329 100644 --- a/doc/mlr.1 +++ b/doc/mlr.1 @@ -2,12 +2,12 @@ .\" Title: mlr .\" Author: [see the "AUTHOR" section] .\" Generator: ./mkman.rb -.\" Date: 2016-06-30 +.\" Date: 2016-07-01 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "MILLER" "1" "2016-06-30" "\ \&" "\ \&" +.TH "MILLER" "1" "2016-07-01" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Portability definitions .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -74,8 +74,8 @@ mlr --from infile.dat put -f analyze.mlr .nf DKVP: delimited key-value pairs (Miller default format) +---------------------+ - | apple=1,bat=2,cog=3 | Record 1: "apple" => "1", "bat" => "2", "cog" => "3" - | dish=7,egg=8,flint | Record 2: "dish" => "7", "egg" => "8", "3" => "flint" + | apple=1,bat=2,cog=3 | Record 1: "apple" => "1", "bat" => "2", "cog" => "3" + | dish=7,egg=8,flint | Record 2: "dish" => "7", "egg" => "8", "3" => "flint" +---------------------+ NIDX: implicitly numerically indexed (Unix-toolkit style) @@ -123,6 +123,14 @@ mlr --from infile.dat put -f analyze.mlr | dish 7 | Record 2: "dish" => "7", "egg" => "8" | egg 8 | +---------------------+ + + Markdown tabular (supported for output only): + +-----------------------+ + | | apple | bat | cog | | + | | --- | --- | --- | | + | | 1 | 2 | 3 | | Record 1: "apple => "1", "bat" => "2", "cog" => "3" + | | 4 | 5 | 6 | | Record 2: "apple" => "4", "bat" => "5", "cog" => "6" + +-----------------------+ .fi .if n \{\ .RE diff --git a/doc/reference.html b/doc/reference.html index d6dc61a19..d19d2ea89 100644 --- a/doc/reference.html +++ b/doc/reference.html @@ -335,8 +335,8 @@ Command-line-syntax examples: Data-format examples: DKVP: delimited key-value pairs (Miller default format) +---------------------+ - | apple=1,bat=2,cog=3 | Record 1: "apple" => "1", "bat" => "2", "cog" => "3" - | dish=7,egg=8,flint | Record 2: "dish" => "7", "egg" => "8", "3" => "flint" + | apple=1,bat=2,cog=3 | Record 1: "apple" => "1", "bat" => "2", "cog" => "3" + | dish=7,egg=8,flint | Record 2: "dish" => "7", "egg" => "8", "3" => "flint" +---------------------+ NIDX: implicitly numerically indexed (Unix-toolkit style) @@ -385,6 +385,14 @@ Data-format examples: | egg 8 | +---------------------+ + Markdown tabular (supported for output only): + +-----------------------+ + | | apple | bat | cog | | + | | --- | --- | --- | | + | | 1 | 2 | 3 | | Record 1: "apple => "1", "bat" => "2", "cog" => "3" + | | 4 | 5 | 6 | | Record 2: "apple" => "4", "bat" => "5", "cog" => "6" + +-----------------------+ + Help options: -h or --help Show this message. --version Show the software version.