public class event implements ActionListener { //_________________________________
public void actionPerformed(ActionEvent Action){
System.out.println("Clicked");
String searchObject = tagTextField.getText();
FileReader fr = new FileReader(searchObject + ".txt");
BufferedReader br = new BufferedReader(fr);
// if(line.startsWith("001")){
// }
That's what I have right now. My goal is that a text file has either a 001 or a 002 or 0003 as their first word. Then, following the word is a letter. I want to be able to identify all the letters that are in a line that start with 001, they all are merged into one variable to be displayed in a JTextField. An example:
001 A
002 B
001 C
001 Z
005 A
002 C
My hope is that the program will return "A C Z". Sadly I asked this question already and got a really good answer, but I decided to not do it the first way and asked if he can implement some HTML in there. Now though, I no longer need HTML but I cannot retrieve his old code that he suggested I used (that would of been perfect for now).
Background: SearchObject is the name of the file.
the last two lines are //'ed out because line isn't definined and I have no idea how to start it. Any help would be very appreciated.
This isn't my full code but the rest of my program I believe is irrelevant because the rest doesn't not deal with file reading or anything.