I would like to clean up a file containing some numbers by eliminating duplicates. The numbers are delimited with a new line.
My idea would be to read the file into an array and then write each element (=each number) into a new file unless it has already been processed. To do that, however, I would need to check whether or not a scalar (containing the new number) is identical to an element of an array (containing all numbers already processed). I did not find anything with regard to such a "contained in" function for arrays. Note that this would involve an operation consisting of an array (the checklist) and a scalar (the new number).
Presumably something like this exists (as it is a fundamental concept in mathematics).
Hints would be greatly appreciated!
In reply to Getting rid of duplicates by New Novice
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |