Hi all,
I need to create a matrix of variable rows and columns. Right now i have 3 rows and two columns and following values.
Output something like
TypeA TypeB
TestCase1 Pass Fail
TestCase2 Pass NA
TestCase3 Pass Pass
Any help is much appreciated.
Thanks,
Jak
lahiru
2
Use arrays to this senarioo.Think it's really easy
myarray=(`cat table.dat|nawk '{print $1}'` `cat table.dat|nawk '{print $2}'`)
After this Your data will get insert in to the myarray.
Then you can fetch data from the array
as below.
${myarray[$0,$1]}
Regards,
Lahiru Jeewantha
awk '{if (NF==3) { printf "|%s\t|%s\t|%s|\n",$1,$2,$3}}' file