Single column to multiple columns in awk

Hi -

I'm new to the awk programming language. I'm trying to print a single column of data to several columns, and I found an article on iTWorld.com (ITworld.com - Printing in columns). It looks like the mkCols2 script is very close to what I need to do, but it looks like the end of the code has been cut off, and the author's contact email doesn't seem to work. Does anyone know how the mkCols2 script might end?

Thanks,
Dave

Code:

# mkCols2 -- organize input into columns
#
BEGIN {
padding=" "
widestCell=1
}

{
cell[NR-1]=$0
if ( length($0) > widestCell )
widestCell=length($0) # save widest data
}

END {
x=((NR+(cols-1))/cols)
rows=x-(x % 1) # calculate number of rows req'd
maxCol=widestCell+2 # calculate column width
for (n=0; n<=NR; n++) { # for each input line
pad=substr(padding,1,(maxCol-length(cell[n])))
rownum=n % rows
row[rownum]=row[rownum] cell[n] pad # add req'd padding
}
for (n=0; n

Replace "for (n=0;n" with

   for (n=0; n<rows; n++) {
      print row[n]
   }
}

Thanks - that works much better!