"Interview" the two possible witnesses by reading the correct line from the streets they live on: head -n 173 streets/Mattapan_Street | tail -n 1 This will give you just line 173 of Mattapan street, because it will take first 173 lines, and then take the last line from those.