I need your help on this...  need to re-arrange this: ---------------------------------------------------------------- - Partition Name: testblade012                                 - - Type: Shared-SMT-4                                           - - Entitled Capacity: 0.30                                      - ----------------------------------------------------------------into this: ---------------------------------------------------------------- - Partition Name                           : testblade012      - - Type                                     : Shared-SMT-4      - - Entitled Capacity                        : 0.30              -   ----------------------------------------------------------------Please let me know how to do this with  SED, AWK, or in any other way.
Rearrange the filecontent in UNIX
text processing
Just printf:while IFS=[:] read f1 f2do    [ $f2 ] && printf '%-40s: %-22s-\n' $f1 $(echo ${f2%-}) || echo $f1done <<<' ---------------------------------------------------------------- - Partition Name: testblade012                                 - - Type: Shared-SMT-4                                           - - Entitled Capacity: 0.30                                      - ----------------------------------------------------------------'Or with awkawk -F'[:]' '$2{sub( *-$,,$2);$0=sprintf(%-40s:%-23s-,$1,$2)}1'