Post
Topic
Board Development & Technical Discussion
Merits 46 from 3 users
Re: All used addresses
by
bob123
on 24/08/2020, 11:13:58 UTC
⭐ Merited by LoyceV (42) ,ETFbitcoin (3) ,o_solo_miner (1)
I want to remove duplicate lines without changing the order, so only keeping the first occurrence.

If i am not mistaken, the following should work:
Code:
cat -n input.txt | sort -uk2 | sort -nk1 | cut -f2- > output.txt

None of these commands needs to hold the file in memory all at once.
But as mentioned previously, sort does need quite some disk space to create temporary files. So that might be a bottleneck, depending on your system specs.