in reply to Assigning values. Simple and Nasty one.
Where are you getting '$1' and '$2'? They does not simply appear. Maybe you need to parse each file of the GRAPH file. But in that we can't help. You don't have explanation on the txt file syntax.