File file = new File("src/ftp.txt");
FileReader fd = new FileReader(file);
BufferedReader br = new BufferedReader(fd);
StringBuilder sb = new StringBuilder();
String str = "";
while ((str = br.readLine()) != null)
{
sb.append(str);
sb.append("\n");
}
int lenth = 100;
String str2=sb.toString();
sb.setLength(0);
for (int i = 1; i <= lenth; i++)
{
str=str2.replaceAll(temp1,i+"");
sb.append(str);
sb.append("\n");
}
FileOutputStream out=new FileOutputStream(file);
out.write(sb.toString().getBytes());
out.close();
}