reads the RI or link index number from file