Jump to content

AWK - transpose

- - - - -

  • Please log in to reply
No replies to this topic

#1
czezz

czezz

    Newbie

  • Members
  • Pip
  • 1 posts
This is my input file:

10004.00,

106473388.00,

1442167619.00,

192.80,

14.71,

318145.44,

941276.69,

311.00,

10037.00,

218609.00,

232698.00,

138.33,

2.95,

104.00,

1014763.31,

7.00,

10006.00,

510197111.00,

5177395202.00,

179.16,

15.42,

189461.72,

967962.06,

341.00,

11491.00,

702082782.00,

17808287130.00,

253.96,

18.02,

162678.22,

2868964.25,

81.00,

10004.00,

106473388.00,

1442167619.00,

192.80,

14.71,

318145.44,

941276.69,

311.00,


I want to transpose it. Each line should be 8 columns. Here is an example:

10004.00,106473388.00,1442167619.00,192.80,14.71,318145.44,941276.69,311.00,

10037.00,218609.00,232698.00,138.33,2.95,104.00,1014763.31,7.00,

10006.00,510197111.00,5177395202.00,179.16,15.42,189461.72,967962.06,341.00,

11491.00,702082782.00,17808287130.00,253.96,18.02,162678.22,2868964.25,81.00,

10004.00,106473388.00,1442167619.00,192.80,14.71,318145.44,941276.69,311.00,


What I can do already, is to put all the column into a 1 line... but I need to put "enter" after each 8 value/string

nawk '$1=$1' RS= input.txt

Does anyone know how to do it ?




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users