Reading pipe seperated file

Hi,
I have a pipe seperated txt file, i need to read the data and work
on it.
Data looks like this:
file
test1|acount1|emp1
test2|acount2|emp2
test3|acount3|emp3
test4|acount4|emp4

when i say emp3, it should display ‘test3’ value and so on.