I am making program that would read string lines, separate them and after that check them and write to texAreas.
The text file has this data:Code:BufferedReader br = new BufferedReader(new FileReader(filename));
while((line = br.readLine()) != null)
{
sepArray = line.split(";");
for(int j = 0; j < sepArray.length; j++)
{
//System.out.println(sepArray[j]);
for(int i = 0; i < sepArray.length; i++)
{
if(i%2 == 0)
{
fta = sepArray[i];
sta = sepArray[i+1];
if(qline.equals(fta))
{
if((fta.equals(oldfta)) && (sta.equals(usta)))
{
break;
}
textArea1.append(fta+"\n");
textArea2.append(sta+"\n");
sta = sepArray[i+1];
oldsta = sta;
oldfta = fta;
usta = sta;
}
else if(fta.equals(oldsta))
{
textArea1.append(fta+"\n");
textArea2.append(sta+"\n");
oldsta = sta;
}
}
}
}
}
John is sad;John cries
John's mom is unhappy; She doen't make dinner
John cries;John's mom is unhappy
Now for loop goes only once, but it should go few times to show all data.
I hope you understood what i met
