shawnbot / tito

Tables In, Tables Out
Creative Commons Zero v1.0 Universal
21 stars 0 forks source link

"auto" format #2

Open shawnbot opened 9 years ago

shawnbot commented 9 years ago

This should be possible with peek-stream. The idea is to make the input format (--read/-r) optional or at least let users set it to auto in order to sniff the input and detect different formats.

For CSV we could use csv-sniffer, or at least riff off what it does. For JSON this should be simple: the presence of a [ or { at the beginning of the input should be enough of a clue, though distinguishing between newline-delimited JSON might be trickier.

shawnbot commented 9 years ago

Also, if filenames are provided as positional arguments, we should suss those out and auto-detect the format if none is provided.