I have a gawk command that works fine. But I have a machine with mawk installed and when I try to install gawk it complains about broken dependencies. I would like to change this line to mawk syntax.
awk -F '[|]{3}' 'BEGIN {OFS="|||"} !seen[$4]++ {print $4,$7,$3,$5,$6,$8,$9,$10,$11}' $1
Input File: It is a Three Pipe delimited file
A|||B|||C|||D|||E|||F|||G|||H|||I|||J|||K||||L|||M|||N|||O|||P|||Q|||R|||S||||T|||U
1|||2|||3|||4|||5|||6|||7|||8|||9|||10|||11|||12|||13|||14|||15|||16|||17|||18|||19
POSIX awk makes use of extended regular expressions which have the possiblility to define character duplication by means of
{m,n}This method of duplication is unfortunately not supported by mawk as can be read from the manual (Section 3 Regular Expressions).
So instead of defining the field separator
FSby means of-F '[|]{3}', you have to make use of-F '[|][|][|]'or-F "\\|\\|\\|"