Code:
$
$ cat -n f25
1 E_TIM 16,
2 ETE 15,
3 EOND 26,
4 EEC 81,
5 E_1 un,
6 E_2 un,
7 E_3 un,
8 E_4 284,
9 E_TIM 17,
10 ETE 15,
11 EOND 29,
12 EEC 82,
13 E_1 un,
14 E_2 un,
15 E_3 un,
16 E_4 249,
$
$ perl -ne 'BEGIN { $fmt = "%-8s %-8s %-8s %-8s %-8s %-8s %-8s %-8s\n" }
if ($. % 8 == 1 and $. > 1) {
printf($fmt, map { $_->[0] } @x);
printf($fmt, map { $_->[1] } @x);
@x = ();
}
/^(\S+)\s+(\S+)$/ and push @x, [ $1, $2 ];
END {
printf($fmt, map { $_->[0] } @x);
printf($fmt, map { $_->[1] } @x);
}
' f25
E_TIM ETE EOND EEC E_1 E_2 E_3 E_4
16, 15, 26, 81, un, un, un, 284,
E_TIM ETE EOND EEC E_1 E_2 E_3 E_4
17, 15, 29, 82, un, un, un, 249,
$
$