Awk equivalents to SQL query data manipulation