home bbs files messages ]

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,478 of 68,980   
   mokomoji to All   
   Re: remove duplicates   
   21 Jan 20 09:53:57   
   
   From: mokomoji@naver.com   
      
   2020년 1월 22일 수요일 오전 2시 30분 28초 UTC+9, Herbert Kleebauer   
   님의 말:   
   > On 21.01.2020 17:26, mokomoji wrote:   
   > > 2013년 4월 21일 일요일 오전 2시 1분 52초 UTC+9, Gabor   
   Grothendieck 님의 말:   
   >    
   > I don't think anybody is interested in a solution for a 10 year old   
   > problem, but just for fun:   
   >    
   >    
   > >> 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   
   >    
   > >>   In the above example variable x's value is the input and the result   
   would be:   
   > >>    
   > >>   C:\A;C:\B   
   >    
   >    
   > > @echo off   
   > > setlocal   
   > > set "x=%path%"   
   > > :main   
   > > for /f "delims=;" %%f in ("%x%") do (set "v=%%~f")   
   > > echo %x%|find /i /c "%v%" 2>nul>nul&&call set x=%%x:%v%;=%%&&call set   
   "z_f=%%z_f%%%%v%%;"   
   > > if "%v%" equ "%x%" goto :pr   
   > > goto :main   
   > > :pr   
   > > echo "%z_f%"   
   > > :end   
   > > pause   
   > > endlocal   
   >    
   > A simpler solution without the external find program:   
   >    
   > set x=C:\A;C:\A;C:\B;C:\A;C:\B;C:\B;C:\A   
   > set y=;   
   > set z=   
   > for %%i in (%x%) do call set  y=%%i;%%y:%%i=%%   
   > for %%i in (%y%) do call set  z=%%i;%%z%%   
   > echo %y%   
   > echo %z%   
      
   oh~! oh~! good...   
      
   @echo off   
   set x=C:\A;C:\A;C:\B;C:\A;C:\B;C:\B;C:\A   
   set y=;   
   set z=   
   for %%i in (%x%) do call set  y=%%i;%%y:%%i=%%   
   for %%i in (%y%) do call set  z=%%z%%%%i;   
   echo %z%   
   pause   
      
   oh god..~!!   
      
   --- 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