Parse line instead of file in get_pos()