Question:
I have got text file:
1 2 3 4 5 |
1 2 4 5 6 7 1 3 5 6 7 8 1 2 3 4 5 6 1 2 4 5 6 7 |
Here first and last line are simmilar. I have a lot of files that have double lines. I need to delete all dublicate.
Answer:
All these seem really complicated. It is as simple as:
1 2 |
gc $filename | sort | get-unique > $output |
Using actual file names instead of variables:
1 2 |
gc test.txt| sort | get-unique > unique.txt |