Dear Monk one more problem is coming... The program is printing the 3 word size only just after the FAN word not talking care of the position in the File 1. Example in the second case 67890 the position is 21 but the output is printing JAK instead of ALA. That means its printing position just next to FAN always instead of the original position