【问题】
tl;dr: I want to output my HashMap in the same CSV file format that I am reading it in.
I want to preface this with: I may be going about this the wrong way. Because I started this thinking one thing and didn’t account for this problem I’m having. So I’m trying to make a small application that will give you a random movie to watch depending on what genre you are in the mood for (similarly to Netflix’s Max application, but considerably dumbed down). I have a list of movies that I’m going to format myself in CSV format, because I recently wrote some code that reads in values from a CSV file and I didn’t have much to alter.
Here is the dilemma: I have read in the CSV formatted file (only a two line sample file), since I know what columns contain what I use a BufferedReader to read in line by line storing each value of the delimited value in its own ArrayList (I know there is a better way but this is what I came up with for now) I then store each ArrayList according to genre into a HashMap. Now I want to be able to write back out to the same file at some point to edit it. So movies that have been watched will be removed from the HashMap and then overwrite the file, so that when it’s read back in next time the movie that was alr