wireservice / csvkit

A suite of utilities for converting to and working with CSV, the king of tabular file formats.
https://csvkit.readthedocs.io
MIT License
6.03k stars 603 forks source link

csvjoin - UnsupportedOperation: underlying stream is not seekable #1268

Closed csawatzkyST closed 2 weeks ago

csawatzkyST commented 2 weeks ago

I recently updated from csvkit 1.1.1 in Fedora 40 to csvkit 2.0.0 in F41.

I used to be able to use process substitution from two commands to redirect output to csvjoin. Now I am getting the errror, "UnsupportedOperation: underlying stream is not seekable".

See: https://csvkit.readthedocs.io/en/latest/tricks.html#specifying-stdin-as-a-file

Example:

$ csvjoin -c C <(echo "A,B,C") <(echo "C,D,E") 
UnsupportedOperation: underlying stream is not seekable

Expected output:

$ csvjoin -c C file1 file2
A,B,C,D,E
jpmckinney commented 2 weeks ago

Set --snifflimit 0 (-y0). Your current command is essentially asking csvjoin to sniff the CSV dialect on a nonseekable input (standard input). CSV Kit does not buffer the input for sniffing, so you need to simply disable sniffing.

csawatzkyST commented 2 weeks ago

@jpmckinney Thank you. I wondered if there was an option, tried a couple, but missed that one.