Gawk output separated by tab

In the gawk below, I am trying to output the file tab-deliminated but don't think that is the correct syntax. Thank you :).

 gawk OFS='/t' '{sub(/-[0-9]+/,"",$2); ar[$2]=$0}
            END{n = asort(ar)
                for (i = 1; i <= n; i++)
                     print ar}' file 

OFS='\t'

---------- Post updated at 10:46 AM ---------- Previous update was at 10:42 AM ----------

Note: Do you mean ORS?

1 Like

Thank you very much OFS='\t' was what I was doing wrong :slight_smile: