In short, break the file after every 6 lines and then truncate new line to tab for these 6 lines.
I am not able to execute the for loop in awk properly.
The idea is something like this: less file| awk '{for .... {if ((nr>=1) && (nr<=6)) print $0}}'| tr "\n" "\t"
NR % 6 : evaluates if the line number is a multiple of 6. if evaluates as non-zero line must be truncated. 0 skip this action and go to the final action (final 1) printf $0 FS; : display the current record + a Field Separator (in this case default space) next : continue to the next record and do not evaluate anything else 1 : it can be any non-zero, and makes awk to use the default action of print $0, if you get to this point
perl -pe 's/\n/ / unless ($. % 6) == 0' file
-pe : print all lines s/\n/ / unless ($. % 6) == 0 : substitute the end of line for space unless that the line number is a multiple of 6