row2column.awk

#!/bin/sh
# row2column.awk
#
# purpose: convert a one-column file into a multi-column file
#
# row2column 
#    edit this script and set number columns if not = 3
#
# Alex Loddoch     loddoch@earth.uni-muenster.de       29.11.99
# sh wrapper and numcols change added by 
# Bill Sparkman    sparky@erinet.com                   29.11.99
#
#
#  I could not get  passed in to awk.  Suggestions?
#if [ $# -lt 2 ]
#  then echo "usage: row2column  "
#       echo " where:  is a complete filename and possibly path"
#       echo "         is a number stating how many columns to create"
#  else
if [ $# -lt 1 ]
  then echo "usage: row2column "
       echo " where  is the file your data is stored in."
  else
#
# this is basically Alex's program, Notice all args are now shell variables
# sh, ksh ... will run this script.  csh will fail - change if statements.
#
awk '
BEGIN {numcols=3;
       #FS=" ";#put in your FieldSep. here, uncomment this line
               #only needed if more than one column in input lines
      }
{ for (i=1; i



Pages maintained by
Prof. Ramón Arrowsmith

Last modified January 17, 2000