reader problem...
/*
* Main.java
*
* Created on August 7, 2006, 10:42 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package readtext;
import java.io.*;// For input & output classes
import java.util.Date;// For the Date class
publicclass create_table{
public create_table(){
}
publicstaticvoid main(String[] args)
throws IOException{
//Read from file
BufferedReader in =new BufferedReader(
new FileReader("C:/Documents and Settings/seng/Desktop/testfile/VehicleNode.txt"));
BufferedReader in1 =new BufferedReader(
new FileReader("C:/Documents and Settings/seng/Desktop/testfile/VehicleNode.txt"));
// Output directory name
String dirName ="C:/Documents and Settings/seng/Desktop/testfile";
File aFile =new File(dirName,"VehiclePosition.txt");
aFile.createNewFile();// Now create a new file if necessary
if(!aFile.isFile())// Verify we have a file
{
System.out.println("Creating " + aFile.getPath() +" failed.");
return;
}
//Variable declarations
String text;
String atext;
while ((text = in.readLine()) !=null)// problem here
{
while ((atext = in.readLine()) !=null)
{
}
System.out.println(text);
}
}
}
i wander why thewhile ((text = in.readLine()) !=null)
can not fully read for the .txt file? it only read for 1st sentance...
howeverwhile ((text = in.readLine()) !=null)
is succesfull to read all text.

