Hey this is what I have so far:
CODE: (named areYouReady271009)
--------------------------
#!/bin/bash
comparedRow=$1;
comparedCol=$2;
comparedFile=$3;
comparedValue=`awk -v comparedAWKCol=$comparedCo
awk '{ print $1,$2 }' $comparedFile | awk -v var=$comparedValue '{$1 = var}1';
--------------------------
Make the script file executable by using the chmod +x areYouReady271009
Run the script like so:
./areYouReady271009 <row> <col> <filename>
e.g:
./areYouReady271009 1 1 /home/public/delimitedfile
would output:
a1 a2
a1 b2
a1 c2
Currently there is no error checking but I will add some shortly
Main Topics
Browse All Topics





by: ozoPosted on 2009-10-26 at 16:15:40ID: 25667971
perl -alne '$a1||=$F[1];print "$a1 $F[2]"'