Skip to content

Commit

Permalink
Re-phrase the help text a little bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
c-blake committed Jul 30, 2023
1 parent d0b71f2 commit 4258123
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions utils/c2tsv.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ type DFAState = enum sFEnd, sNonQuo, sQuo, sQuoInQuo, sCRAtEnd, sCRInQuo

proc c2tsv(tab='\t', TabSub="\\t", nl='\n', NlSub="\\n", log: set[Log]={},
si="stdin", bSz=65536): int =
## THERE IS NO ONE SPEC FOR "CSV". This program converts rfc4180-ish quote-
## escaped CSV UTF-8 on stdin to *strictly separated*, \\-escaped IANA TSV on
## stdout. Traits here that vary among CSV tools:
## THERE IS NO ONE SPEC FOR "CSV". This program moves rfc4180++ escape-quoted
## CSV UTF-8 on stdin to *strictly separated*, \\-escaped IANA TSV on stdout.
## Traits here that vary among CSV tools:
## - Accepts {\\r|\\r\\n|\\n} for end-of-line; Always emits *nl* (incl @EOF).
## - \\n & ',' inside quoted fields are supported.
## - " is ok in unquoted fields; Fields starting w/" must obey quoting rules.
## Output is soundly record&field split-parsable w/{\\\\, \\t, \\n} needing
## de-escape post-framing to get original 8-bit vals. Parsing ease & pipeline
## | file parallelism imply higher level ideas (header | table struct..) are
## best done via `popen("c2tsv")` | temp files.
## Output is soundly record-field-split-parsable but {\\\\,\\t,\\n} need
## post-frame unescape to recover 8-bit vals. Parsing ease & pipeline | file
## parallelism imply higher level ideas (header/table struct..) are best done
## by temp files | `popen("c2tsv")`.
if tab in TabSub: erru &"`TabSub` must not contain `tab`\n"; return 1
if nl in NlSub : erru &"`NlSub` must not contain `nl`\n"; return 1
const BackSub = "\\\\"
Expand Down

0 comments on commit 4258123

Please sign in to comment.