I have a .txt file containing document information (For 1400 documents). Each document has an ID, title, author, area and abstract. A sample looks like this:
.I 1
.T
experimental investigation of the aerodynamics of a
wing in a slipstream .
.A
brenckman,m.
.B
j. ae. scs. 25, 1958, 324.
.W
experimental investigation of the aerodynamics of a
wing in a slipstream .
[...]
the specific configuration of the experiment .
I want to put each of these into 5 arrays dedicated to each category. I'm having trouble inserting the title and abstract into a single array position, can anyone tell me what's wrong with this code? What I am trying to do is insert the text lines into position x after a ".T" is read and stop when it finds a ".A", when it happens, increase position by 1 for it to fill the next position
try{
collection = new File (File location);
fr = new FileReader (collection);
br = new BufferedReader(fr);
String numDoc = " ";
int pos = 0;
while((numDoc=br.readLine())!=null){
if(numDoc.contains(".T")){
while((numDoc=br.readLine())!= null && !numDoc.contains(".A")){
Title[pos] = Title[pos] + numDoc;
pos++;
}
}
}
}
catch(Exception e){
e.printStackTrace();
}
The goal is to have all the information within a single line of String. Any help would be greatly appreciated.