com awk
:
awk '{ if(NF>4) for(i=5; i<=NF; i+=4) $i = "\n" $i } 1' file
com sed
:
sed 's/ /\n/4;T;P;D' file
com perl
:
perl -lpe '$c = 0; s/ /++$c % 4 ? " " : "\n"/goe' file
Saída:
1
2 4 5 6
7 19
20
22
24 26 27
29 30 31 32
34 40 50 56
58
234 235 270 500
1234 1235 1236 1237
2300