I have a script that is running and uses
lspci -s 0a.00.1
This returns
0a.00.1 usb controller some text device 4dc9
Do you really want the last four characters? It looks like you want the last "word" on the line:
awk '{ print $NF }'
This will work if the ID is 3 characters, or 5, as well.