Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch.nt    |    Fun with Windows NT batch files    |    68,980 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 67,475 of 68,980    |
|    FileGod to Gabor Grothendieck    |
|    Re: remove duplicates    |
|    21 Jan 20 01:54:44    |
      From: filegod@sbcglobal.net              On Saturday, April 20, 2013 at 10:01:52 AM UTC-7, Gabor Grothendieck wrote:       > I have a string that I wish to prepend to my path, say:       >        > set x=C:\A;C:\A;C:\B;C:\A;C:\B;C:\B;C:\A       >        > Typically x has about 6 components but only 2 unique ones. I do not know       ahead of time what the components are. I would like to remove all but the       first occurrence of any component. We can assume that duplicate components       appear in the exact same        form as the non-duplicates, (e.g. we would never have both C:\X\Y and       C:/X/Y). In the above example variable x's value is the input and the result       would be:       >        > C:\A;C:\B       >        > Some desirable criteria include:       > - not to use any software that does not come with Windows       > - run quickly as its done on the fly each time I run an associated program       so it could affect the start up time if it were too slow       > - I would prefer not to write any files in doing this       >        > I guess I could just ignore this issue and just let there be duplicates on       the path (and in fact that is what I am currently doing) but if there is a       nice solution to this it would make the resulting PATH a bit cleaner.              You mean you want to remove duplicate lines of text right? here is that       DelDupeText.cmd I wrote a few years ago:              ::DelDupeText.cmd       @echo off       for /f "tokens=* delims= " %%a in (Old.txt) do (       find /i "%%a" New.txt       if errorlevel 1 echo %%a>>New.txt       )              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca