#!/bin/sh awk '{printf("%s %s _nsw_ %s\n",$1,$7,$0)}' $1 | sort | awk '{printf("%s\n",substr($0,index($0,"_nsw_")+6,length($0)))}' >$1.sorted