Deleting duplicate lines in a file using Java

后端 未结 14 578
予麋鹿
予麋鹿 2020-12-14 01:39

As part of a project I\'m working on, I\'d like to clean up a file I generate of duplicate line entries. These duplicates often won\'t occur near each other, however. I came

14条回答
  •  天命终不由人
    2020-12-14 02:14

    Does it matter in which order the lines come, and how many duplicates are you counting on seeing?

    If not, and if you're counting on a lot of dupes (i.e. a lot more reading than writing) I'd also think about parallelizing the hashset solution, with the hashset as a shared resource.

提交回复
热议问题