Putting read data into a combined file based on certain attributes
I have to scroll to read it all, so without looking at the code: Yes, split it.

And now with looking at the code:
I would try to extract the content of your for loop and give the method a nice name.

Afterward you can check how to split this method.

Maybe you want to have a look at one-thing-extract-till-you-drop (also check the comments)