Skip to end of metadata
Go to start of metadata

csv-split can also stream the data associated with multiple ids, to specific sockets, named pipes or files. See csv-split --help for more details about the semantics.

You can mix publishing to tcp sockets, local sockets, files, or pipes, if you need.

> # publish data corresponding to ids 2 and 3 to tcp:8888, 0 to tcp:9999 and the rest to stdout
>  csv-paste line-number "line-number;size=5;index" \
     | csv-split --fields ,id "2,3;tcp:7777" "0;tcp:8888" "...;-" > other_ids.csv

> # in separate terminal
> socat tcp:localhost:7777 - | head
6635893,3
6635897,2
6635898,3
6635902,2
6635903,3
6635907,2
6635908,3
6635912,2
6635913,3
6635917,2

> socat tcp:localhost:8888 - | head
28950290,0
28950295,0
28950300,0
28950305,0
28950310,0
28950315,0
28950320,0
28950325,0
28950330,0
28950335,0

> head other_ids.csv
1,1
4,4
6,1
9,4
11,1
14,4
16,1
19,4
21,1
24,4
 

csv-split works as before (splitting data into files) if no streams are specified. Furthermore if there are streams assigned to some ids and none to "..." , then the data relating to the remaining ids is discarded.

  • No labels