i have a file that consist like this
/1/a/a/a/Female/Single/a/a/January/1/1920/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a
and here is my StringTokenizer code:
public void retrieveRecords(){
String holdStr="";
try {
fileRead=new FileReader(fileNew);
read=new Scanner(fileRead);
while(read.hasNext()){
holdStr+=read.nextLine()+"\n";
}
read.close();
StringTokenizer strToken=new StringTokenizer(holdStr, "/");
while(strToken.hasMoreElements()){
rows=new Vector();
for(int i=0; i<column.length; i++){
rows.add(strToken.nextElement());
}
ViewTablePanel.tblModel.addRow(rows);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}
i actually don't have any idea what is the problem as well as i researched every reason why nosuchelementexception
would happened but i am not doing all those reasons why it won't work. any suggestions would be open thank you so much :)