I was trying to remove the first line in text file using java code referencing from this link but still the scanner does not contain any text, so it write nothing in the text file, please help, what is then problem...? here is a peace of code,
File path=new File("C:/Users/kassim Ismail/workspace/Coding/textdoc.txt");
Scanner scan=new Scanner(path);
FileWriter newread=new FileWriter("C:\\Users\\kassim Ismail\\workspace\\Coding\\textdoc.txt");
BufferedWriter newreader=new BufferedWriter(newread);
while(scan.hasNextLine()){
String nextline=scan.nextLine();
if(nextline.equals("\n")){
newreader.newLine();
}else{
newreader.write(nextline);
}
}
scan.close();
newreader.close();
newread.close();
}