set theResults to every text item of (do shell script "/usr/local/bin/gawk -v FPAT='\"[^\"]+\"|[^,]*' 'BEGIN{RS=\"[\\r\\n]\";ORS=\"~\";OFS=\"\\t\"} NF==7 {split($NF, a, /\\.\\s*#\\s*/) split($2,c,\"/\")};NR!=1&&NF<=7 {print NR-1,a[length(a)],$6,$5,$3,$4,a[length(a)-1]}'<<<" & quoted form of theResponse & "| sed 's/\"//g'" & "| sed 's/\\.\\t/\\t/g'" & "| sed 's/~$//'") --remove double quotes, remove periods followed by field separator (at the end of the case number field), remove trailing record separator, put number in front of results in order to match choice from this list to expression ID from indexlist list.