I would actually create a for loop, First detect how many files there are... Next you want to read the file one by one, Store each line using a scanner or some other file reader method to store line...