okay fellas, i have come a long way on my journey. ive been trying to write a class which contains a method searchFile(). all i want that method to do is: any text file that gets passed to my search method, read it in and check to see if it contains the two strings in it at all. I am close but I am missing something, any help is greatly appreciated thanks.
import java.io.*;
import java.util.*;
public class PunchFile{
private
String xString = new String("00001X000001X057000000000CO083100");
private String zString = new String("07573Z07573");
static File fPun = new File("C:\\workfiles\\datafile.001");
public static void main(String args[]){
PunchFile pf = new PunchFile();
pf.searchFile(fPun);
int searchFile(file fFile){
fFile = fPun;
Vector vFile = new Vector();
BufferedReader brSearch;
String sOneLine;
brSearch = new BufferedReader(new FileReader(fPun));
sOneLine = brSearch.readLine();
while (sOneLine != null) {
vFile.add(sOneLineline);
sOneLineline = brSearch.readLine();
while(sOneLine != null){
if (!vFile.contains(xString)) {
System.out.println("no x line");
}
else if (!vFile.contains(zString)) {
System.out.println("no z line");
}
else {
System.out.println("this file has both lines");
}
}//end while2
line = br.readLine();
}//end while1
}//end method
}//end main
}//end class