Convert CSV records to TSV: Difference between revisions
m
use a file
m (handle \r) |
m (use a file) |
||
Line 258:
end
const testfile = "test.tmp"
fh = open(testfile, "w")
" a , \"b\"",▼
,a
a,"
"12",34
a\tb, TAB
a\\tb
a\\n\\rb
a\0b, NUL
a\rb, RETURN
a\\b""")
close(fh)
for test_string in split(read(testfile, String), "\n")
csv, tsv = csv_tsv(test_string)
println(lpad(csv, 12), " => ", tsv)
Line 285 ⟶ 291:
a , "b" => a <TAB>b
"12",34 => 12<TAB>34
a\\tb => a\\tb
a\\n\\rb => a\\n\\rb
a\rb, RETURN => a\rb<TAB> RETURN
a\\b => a\\b
</pre>
|