burstus1 , Thanks! This is a great code and very interesting , I am not able to understand fully ,
I got sprint %-17s , to get the space, then what is the array function and till end couldnt understand. Appreciate if you can explain little bit. Thanks again for the help.
awk '
/^$/{ i=0 # Set output row counter to 0 when you find an empty line.
}
!/^$/{ i++ # Increment output row counter when you find a line with data.
x=sprintf ("%-17s", $0) # Set x to current line expanded to length 17
# by adding trailing spaces.
a=a x # Add expanded current line to the end of row i data.
}
END{ for(j=1;j<=i;j++) print a[j] # Print data for each accumulated row.
}' file1 # Read input data from a file named file1.