i have been using an actionListenerto pass text from numerous TextFields into a text file named writetouser.txtthis works fine though i have noticed that this text is just dumped and is not in the format of an array. For the purposes of this application it is necessary that i am able to search this text file and show values based on searches entered. I have a file which reads the data from the text file and have attempted to convert the data to CSV's so it is is readable as an array. i am wondering what must be entered instead of user, pass in order to take the text from inside the filewritetouser.txt.
Addendum:
public void ReadUser()
{
try{
// Open the file
FileInputStream fstream = new FileInputStream("writetouser.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(fstream));
String strLine;
//Read File Line By Line
while ((strLine = br.readLine()) != null) {
// Print the content on the console
//System.out.println (strLine);
String[] items = strLine.split(",");
String[][] usersArray = new String [10][2];
for (String item : items) {
System.out.println(item);
}
}
//Close the input stream
in.close();
}catch (Exception e){
//Catch exception if any
System.err.println("Error: " + e.getMessage());
}
} }
here is an example of the data which i am trying to separate. it is entered into textfile as
inputUser = user + ", " + pass;
writetouser.WriteToUser(inputUser);
dburgess, 2345