u can get line by line from a file... using
getLine(<filename>,<line>)
as i suggested before afterwards u may have to check for the presence of black space to sperate into different words. then do the manipulation to output x, using comparison.