Thanks guys,
I fixed it in the end and added a few extra bits... it takes a .16800 pmkid file and prints out the ssid of each separate pmkid.
#!/bin/bash
function hex2string () {
I=0
while [ $I -lt ${#1} ];
do
echo -en "\x"${1:$I:2}
let "I += 2"
done
}
read -p 'Enter PMKID filename: ' filename
while read -r pmkid; do
ssid="${pmkid:59:500}"
hex2string "$ssid"
echo
echo "$pmkid"
done < $filename