I have a file of line blocks, each of which ends with a specific keyword. I currently have a stream reader installed, which adds each line of the file to the list up to the end of the current block (the line contains a keyword indicating the end of the block).
listName.Add(lineFromFile);
Each block contains information, for example. Book bookName, Author AuthorName, Journal JournalName, etc. Thus, each block hypothetically represents one element (book, magazine, conference, etc.).
Now, when about 50 or so blocks of information (elements) I need a way to store information, so I can manipulate it and store each author (s), title, page, etc. and know what information comes with which element, etc ..
When typing, I came up with the idea of saving each element as an object of the "Item" class, but with potentially several authors I'm not sure how to achieve this, because I thought maybe using a counter to name a variable, for example
int i = 0;
String Author[i] = "blahblah";
i++;
But as far as I know, this is not permissible? So my question basically is what will be the easiest / easiest way to store each element so that I can manipulate the lines to store each element for later use.
@yamen is an example file:
Author Bond, james
Author Smith John A
Year 1994
Title For beginners
Book Accounting
Editor Smith Joe
Editor Doe John
Publisher The University of Chicago Press
City Florida, USA
Pages 15-23
End
Author Faux, M
Author Sedge, M
Author McDreamy, L
Author Simbha, D
Year 2000
Title Medical advances in the modern world
Journal Canadian Journal of medicine
Volume 25
Pages 1-26
Issue 2
End
Author McFadden, B
Author Goodrem, G
Title Shape shifting dinosaurs
Conference Ted Vancouver
City Vancouver, Canada
Year 2012
Pages 2-6
End