java - Reading and Storing Multiple Files -


what trying read multiple files , store contents of files data structure. know how many files have , names of files number , names of files can change. after read in contents of files , store them need able find specific string contains across files.

what having trouble have no idea easiest data structure task. thinking hashmap, , using file names key. work? there better data structure? using java

edit: have been reading contents of file arraylist because each line contains separate information need able reference in future.

if files not big enough can use simple map

       map<string, list<string>> map = new hashmap<string, list<string>>(); 

key(string) file name value(arraylist) contents of file (lines)

if files big data structure not sufficient.


Comments

Popular posts from this blog

Change the color of an oval at click in Java AWT -

c# - Unity IoC Lifetime per HttpRequest for UserStore -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -