java修改csv文件指定行列内容_读入 csv 后修改指定位置数据再写出

【问题】

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值