Ignore parts where we don't know the name of the file
Also record which line field was written
Print contents to a file specified by property
Use Multisets to order elements for printing