keep duplicate number records only - perl
- by manu
Hello
I have one text string which is having some duplicate characters (FFGGHHJKL), these can be made unique by using the positive lookahead [perl script for the same$ perl -pe 's/(.)(?=.*?\1)//g'].
(FFEEDDCCGG OUTPUT == FEDCG)
My question is how to make it work on the numbers (Ex. 212 212 43 43 5689 6689 5689 71 81 === output should be 212 43 5689 6689 71 81) ? Also if we want to have only duplicate records to be given as the output from a file having n rows
(212 212 43 43 5689 6689 5689 71 81 \n
66 66 67 68 69 69 69 71 71 52 ..\n
..
..
\n...
OUTPUT == 212 212 43 43 5689 5689 \n
66 66 69 69 69 71 71)
then what should be done ?
Thanks and regards
-manu