Skip to main content
added 154 characters in body
Source Link
Ole Tange
  • 37.5k
  • 34
  • 119
  • 226

In Bash you can do:

doit() { parallel --header : --colsep , -n4 echo UserID {1} Consumption {2} {4} {6} {8}; }
export -f doit
cat table.csv | parallel --pipe --colsep , --header : --group-by UserID -kN1 doit

I do not see you can do it in a single parallel instance. What you want is to mix --pipe and normal mode, and GNU Parallel can't really do that.

In Bash you can do:

doit() { parallel --header : --colsep , -n4 echo UserID {1} Consumption {2} {4} {6} {8}; }
export -f doit
cat table.csv | parallel --pipe --colsep , --header : --group-by UserID -kN1 doit

In Bash you can do:

doit() { parallel --header : --colsep , -n4 echo UserID {1} Consumption {2} {4} {6} {8}; }
export -f doit
cat table.csv | parallel --pipe --colsep , --header : --group-by UserID -kN1 doit

I do not see you can do it in a single parallel instance. What you want is to mix --pipe and normal mode, and GNU Parallel can't really do that.

Source Link
Ole Tange
  • 37.5k
  • 34
  • 119
  • 226

In Bash you can do:

doit() { parallel --header : --colsep , -n4 echo UserID {1} Consumption {2} {4} {6} {8}; }
export -f doit
cat table.csv | parallel --pipe --colsep , --header : --group-by UserID -kN1 doit