https://github.com/turkeymcmac/tablestreams
For reading and writing tables line by line in various formats.
https://github.com/turkeymcmac/tablestreams
parser tables
Last synced: 2 days ago
JSON representation
For reading and writing tables line by line in various formats.
- Host: GitHub
- URL: https://github.com/turkeymcmac/tablestreams
- Owner: TurkeyMcMac
- Created: 2018-11-16T12:21:43.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-17T14:43:35.000Z (over 7 years ago)
- Last Synced: 2025-03-15T22:31:47.578Z (over 1 year ago)
- Topics: parser, tables
- Language: Java
- Size: 234 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tablestreams
tablestreams is a tool for streaming tables in and out of a program. The
interface is generic across multiple table formats, and so can also be used to
convert between them. Currently supported are TSV, CSV, DSV (CSV with delimiters
other than commas), and (buggy) XLSX.
#### Examples
Here, a table is read from the TSV format to a CSV format:
```
TableReader reader = new TSVTableReader(new FileInputStream("table.tsv"));
TableWriter writer = new CSVTableWriter(new FileOutputStream("table.csv"));
writer.writeTable(reader);
```
This does the same except that it only reads/writes one line:
```
TableReader reader = new TSVTableReader(new FileInputStream("table.tsv"));
TableWriter writer = new CSVTableWriter(new FileOutputStream("table.csv"));
writer.writeRow(reader.readRow());
```
#### XLSX Support
I have tried to write my own XLSX parser, but it is hard to know how often it
will work, as documentation of the format online is a bit lacking. However, the
library can both read and write XLSX files.