The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 02-18-2007
vgersh99's Avatar
vgersh99 vgersh99 is online now
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,169
here's something to start with:

nawk -F',' -f gg.awk File1 File2

gg.awk:
Code:
FNR==NR{
  arr[FNR]=$0
  next;
}
{
  f1num=split(arr[FNR], f1A, FS)
  if ( f1num != NF ) {
     printf("error: [%d] - unequal number of fields\n", FNR)
     next
  }
  for(i=1; i<=NF; i++)
    if (f1A[i] != $i)
     printf("error: [%d]::[%d] - non-equal fields: [%d != %d]\n", FNR, i, f1A[i]
, $i)
  split("", f1A)
}
Reply With Quote