How do i do the vertical to horizontal??

51009

8746

8912

17986

20315

24998

5368

38934

7805

8566

9993

14998

24996

5318

35254

5747

5999

7000

15000

25000

0

[/CODE]

I want the above o/p to be in row wise...
every row shul hav 7 colmuns oly...

How about:

xargs -n7 < file
3 Likes
sed '/^$/d' file |   awk 'NR%7!=0 {a=a>0?a OFS $1:$1;next} { print a OFS $1;a=""}' OFS=","

Another ( awkish :slight_smile: ) awk:

awk 'NF && ORS=++i%7?FS:RS' file
1 Like

Another approach:

grep -v '^$' file | paste - - - - - - -