Can anyone tell me what could be the solution to following :
I have one .txt file which contains some "seed" information. This seed may appear multiple time in the file so what I want do is if this seed appears again in the file then that line should be removed.
Please provide the script code also:
Here in I am attaching the text file.
Thanks in advance..
(Perl arrays are numbered from zero, so $F[9] is the tenth field. The -a option causes Perl to split the input line into the array @F, somewhat similarly to how awk works.)
The input line is printed unless the hash %seen already has an entry for the tenth field. We also add one to its value, which causes it to be set (to one) if it didn't exist before. Thus, the %seen value for the current seed will be set the next time it is encountered.
For the sample file you posted, this reduces 1,274 lines to just 72 lines.