Home

April 8th, 2008

05:13 pm
DeDupe Awk Script

A quick awk script that will check a field, if the field is unique (you'll have to 'sort' on that field first) it'll print out the entire line. Otherwise, it skips to the next line.
BEGIN{
        FS=",";
}
{
        if (OLDFD != $1) {
                print $0;
                OLDFD=$1
        }
}