Closed tseemann closed 3 years ago
Unless rewrite the whole architecture of csvtk, it's huge of work.
That's a shame.
I think it could be done using a wrapper that parsed the //
and used temp files.
But it would not have the efficiency.
No need to use temp files. Just passing data between functions in memory, it could reduce steps of parsing data.
All commands can be methods of a CSV object,
struct CSV {
}
func (csv CSV) Read(file, options)
func (csv CSV) Write(file, options)
func (csv CSV) A(options) // replace old data inplace
func (csv CSV) B(options) // replace old data inplace
The pipe would be
csv.Read(file, options).A(options).B(options).Write(file, options)
Long term enhancement:
Tools like
mlr
allow chaining of sun-commands within the one command. Couldcsvtk
ever do this?instead of piping?
The
//
is just an example sub-command digraph, could use anything.