Jump to content

Convert CSV records to TSV: Difference between revisions

m
handle \r
(julia example)
m (handle \r)
Line 253:
end
t = join(p,"<TAB>")
s = replace(str, "\\" => "\\\\", "\t" => "\\t", "\0" => "\\0", "\n" => "\\n", "\r" => "\\r")
t = replace(t, "\\" => "\\\\", "\t" => "\\t", "\0" => "\\0", "\n" => "\\n", "\r" => "\\r")
return s, t
end
Line 271:
"a\0b", # That is a NUL character
"a\nb", # That is a LF (linefeed) character
"a\rb", # That is a CR (carriage return) character
raw"a\b"]
csv, tsv = csv_tsv(test_string)
Line 289 ⟶ 290:
a\0b => a\0b
a\nb => a\nb
a\rb => a\rb
a\\b => a\\b
</pre>
4,105

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.