`tail -f`?
Why doesn't this work?
tail -f file.csv | xsv table
This works:
tail file.csv | xsv table
Thanks.
I think it's because tail -f is non-ending, the output stream is never closed, so xsv table is waiting for the end of the stream before it can output the table.
From the xsv table --help:
Note that formatting a table requires buffering all CSV data into memory.
This answer is spot on, same as the sort command. @cajund anything else to address before this issue can be closed?
You can do this:
tail -f file.csv | (while read line; do echo "$line" | xsv table; done )
But the resulting cells will not be correctly aligned if their length are different.
Anyway, this method can be more useful with select
tail -f file.csv | (while read line; do echo "$line" | xsv select 1; done )