I
iksrazal
Hi all,
I have tried posting this problem a few times looking for a solution.
What I have works but is slow.
I have to read unordered data from a text file. Data A has a
one-to-many relationship with Data B, and Data B has a one-to-many
relationship with Data C . Once I find Data A, Data B and Data C could
be anywhere in the file. So I do a RandonAccessFile.seek(0) . This
needs to be repeated hundereds of times for lots of Data B and Data C
relationships.
I'd like to put the file in memory. However, I'm using Scanner and
regex to get the data. I don't think I can run Scanner on ByteBuffer
per line.
So my latest idea is to read the file per line and store it in List. So
a 10,000 line file would have a 10,000 size List. That way I could run
Scanner on the Strings in the List, and Iterate repeatably. The data in
the List would be read only.
Any advice appreciated.
iksrazal
I have tried posting this problem a few times looking for a solution.
What I have works but is slow.
I have to read unordered data from a text file. Data A has a
one-to-many relationship with Data B, and Data B has a one-to-many
relationship with Data C . Once I find Data A, Data B and Data C could
be anywhere in the file. So I do a RandonAccessFile.seek(0) . This
needs to be repeated hundereds of times for lots of Data B and Data C
relationships.
I'd like to put the file in memory. However, I'm using Scanner and
regex to get the data. I don't think I can run Scanner on ByteBuffer
per line.
So my latest idea is to read the file per line and store it in List. So
a 10,000 line file would have a 10,000 size List. That way I could run
Scanner on the Strings in the List, and Iterate repeatably. The data in
the List would be read only.
Any advice appreciated.
iksrazal