Change Lines into column

Hello

how can I change lines into column?
e.g.

I have a Text file which looks like:

Surename......
Address.....
Phonenumber.....
Zipcode..
Surename...
Address....
Zipcode
Surename...

I want that Surename is in column 1 and every following line should be in additional colums.
how can I do this easily?

has someone any idea?

thanks for support

Please provide a representative sample of input you have and output you expect

hi

the input file I have generated from a xml file. Means in the beginning of line sometimes there is a space or tab.

the content is:

SURNAME= Mueller
    ADDRESS= Schulstreet 14
    POSTCODE= 86348
    PHONE= +44 998763
SURNAME= Schmidt
    ADDRESS= Westroad 20
    POSTCODE= 45694
    INFO= sometimes the infoline has a big content so that
the line itselfe is visible in more line.
SURNAME=Schuster 
    ADDRESS= Usestreet 80
    PHONE= +44 8963447

the output should like :

SURNAME= Mueller     ADDRESS= Schulstreet 14    POSTCODE= 86348 etc..
SURNAME= Schmidt    ADDRESS= Westroad 20      POSTCODE= 45694 etc..
SURNAME=Schuster     ADDRESS= Usestreet 80    PHONE= +44 8963447

thanks for support

Please use code tags as required by forum rules!

Try

awk '/SURNAME/ {$0="\n"$0} END {print "\n"}  1' ORS=" " file
SURNAME= Mueller ADDRESS= Schulstreet 14 POSTCODE= 86348 PHONE= +44 998763 
SURNAME= Schmidt ADDRESS= Westroad 20 POSTCODE= 45694 INFO= sometimes the infoline has a big content so that the line itselfe is visible in more line. 
SURNAME=Schuster ADDRESS= Usestreet 80 PHONE= +44 8963447 
1 Like

@ RudiC

His o/p requirement is little different I think

Skipping the first line and removing unexpected last trailing space before prompt

awk 'NR>1{$0=(/SURNAME/?"\n":" ")$0}END{print "\n"}1' ORS= yourfile
1 Like