Hi skuthe,
Well, I thought about it. It seems to me the following will do what you want (and it's simpler):
Command line syntax:
% my.awk col_1 col_2 ... col_n file
BEGIN{
# Get list of columns from command line.
# Also get MaxCols.
}
#main
{
# Use list of columns to build SUBSCRIPT made
# up of concatenated list of values from those
# columns.
array[SUBSCRIPT]+=1;
# Use array[SUBSCRIPT] to test each record to see
# if it was a duplicate.
(if array[SUBSCRIPT] > 1)
{
print $0 > "dupefile.txt";
}
else
{
print $0 > "otherfile.txt";
}
}
Grant.
Well, I thought about it. It seems to me the following will do what you want (and it's simpler):
Command line syntax:
% my.awk col_1 col_2 ... col_n file
BEGIN{
# Get list of columns from command line.
# Also get MaxCols.
}
#main
{
# Use list of columns to build SUBSCRIPT made
# up of concatenated list of values from those
# columns.
array[SUBSCRIPT]+=1;
# Use array[SUBSCRIPT] to test each record to see
# if it was a duplicate.
(if array[SUBSCRIPT] > 1)
{
print $0 > "dupefile.txt";
}
else
{
print $0 > "otherfile.txt";
}
}
Grant.