this is how.
import java.io.*;
public class SplittingText {
public static void main(String[] args) {
// initialization
BufferedReader bi = new BufferedReader(new InputStreamReader(System.in));
String target = null;
String path = "splittingText.txt";
try {
File file = new File(path);
BufferedReader br = new BufferedReader(
new InputStreamReader(
new FileInputStream(file)));
// get user input
System.out.println("Which street?:");
try {
target = bi.readLine();
} catch (IOException ioe) {
System.out.println("IO error reading command line input");
System.exit(1);
}
String line;
while((line = br.readLine()) != null) {
if(line.indexOf(target) != -1)
break;
}
String[] s = line.split("\\=");
System.out.println("value for " + target +
" is: " + s[1]);
br.close();
} catch(IOException e) {
System.out.println("read error: " + e.getMessage());
}
}
}
Also, since you're new, if you were wondering how to get the above box use [/code] and [code] only reversed the other way (Mine are backwards so there isn't a box)