Hi,
I try to read file line be line and store some value that beginning with special expression. The problem that i need to read the file again from the beginning after finish the first time.
My Code(procedure):
IFL ifl = new IFL();
BufferedReader input;
String Regex[] = {"Favorite:","FullPAth:","Date:","Rating:","Comment:"};
int c1=0;
String Fav[] = new String [(ifl.NOF(UserProfile)*4)+ifl.NOF(UserProfile)];
String aLine1 = null;
for (int i=0; i<5; i++){
input = new BufferedReader(new
FileReader("IFL\\User_Profile\\"+UserProfile+".dat"));
Pattern pattern = Pattern.compile(Regex.toString());
while((aLine1 = input.readLine()) != null) {
Matcher m1 = pattern.matcher(aLine1);
if (m1.find()){
Fav[c1] = aLine1.substring(m1.end());
c1++;
}
}
input.close();
}