Keep 3 values in each row

Hi,

I have n number of values like

1
2
3
4

I want the output like

1 2 3
4 5 6
- - -
- - -

Please help me on this:wall:

paste -d" " - - - < file

Hi bartus11

Thans a lot:)

using AWK

 awk '{printf NR%3?$0 FS:$0 "\n"}' filename 

Note: It is better to disable the format field when using printf on an IO source.

awk '{printf "%s",NR%3?$0 FS:$0 "\n"}' filename