I have an HashMap<String,List<String>> to be written onto a text file. Using poi api i was able to write successfully it to an excel. Now I have to write it to a text file.
The key of the HashMap is a String that represents the column header value
The value of the HashMap is a List<String> that represents the column values.
consider this a sample HashMap -> ("NAME",[JOHN, PAUL, JAI])
I want the output in my text file as below -
NAME AGE COUNTRY
JOHN 20 INDIA
PAUL 23 UK
JAI 25 GERMANY
All the values list of in the HashMap will be of the same size (3 as in the example). Could you suggest the logic of how can I write since a text file goes line by line rather than column wise as in a excel api