Commit 7b8c3ca
Add CSV::TSV class for tab-separated values (#319)
GitHub: fix GH-272
This adds `CSV::TSV` that uses `\t` as the default column separator.
How to use:
```ruby
require "csv"
# Read TSV file with default tab separator
CSV::TSV.read("data.tsv")
# Parse TSV string
CSV::TSV.parse("a\tb\tc")
# Generate TSV content
CSV::TSV.generate do |tsv|
tsv << ["a", "b", "c"]
tsv << [1, 2, 3]
end
```
Reported by kojix2. Thanks!!!
---------
Co-authored-by: Sutou Kouhei <[email protected]>1 parent 3a7e7c7 commit 7b8c3ca
2 files changed
+38
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2129 | 2129 | | |
2130 | 2130 | | |
2131 | 2131 | | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
2132 | 2138 | | |
2133 | 2139 | | |
2134 | 2140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
0 commit comments