Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch    |    Fun with MS-DOS batch files    |    42,547 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 40,898 of 42,547    |
|    ehabaziz2001@gmail.com to All    |
|    Re: processing same files with same pref    |
|    17 Jan 14 01:20:00    |
   
   My dir.lst as like this :   
   *************************   
   wady0_Hold.out.new   
   wady0_Post.out.new   
   wady2_Hold.out.new   
   wady2_Post.out.new   
   wady3_Post.out.new   
   wady4_Hold.out.new   
      
   For missing pairs I am doing this :   
      
   dir /b %folder%\*.out.new > dir1.lst   
      
   @echo off    
   for /f "tokens=1,* delims=_" %%a in (dir1.lst) do (    
    echo %%a   
    ::for missing pairs   
    if not exist %folder%\%%a_Post.out.new copy nul %folder%\%%a_Hold.out.new   
    if not exist %folder%\%%a_Hold.out.new copy nul %folder%\%%a_Post.out.new   
       
    pause ""   
   )   
   But I can see that the new created files are created over the old ones with   
   the same names . That is against the syntax written above ????   
      
      
      
   بتاريخ الخميس، 16 يناير، 2014 UTC+2 6:47:38 م، كتب   
   foxidrive:   
   > On 17/01/2014 01:09, ehabaziz2001@gmail.com wrote:   
   >    
   >    
   >    
   > >> > @echo off   
   >    
   > >> >    
   >    
   > >> > for /f "tokens=1,* delims=_" %%a in ('dir *.txt /b ') do (   
   >    
   > >> >    
   >    
   > >> > if not exist "%%a.txt" copy "%%a_*.txt" "%%a.txt"   
   >    
   > >> >    
   >    
   > >> > )   
   >    
   > > I can find only 1 part from each kind :   
   >    
   > >    
   >    
   > > ehab_part1.txt    
   >    
   > > ehab_part2.txt    
   >    
   > >    
   >    
   > > AndyJones_part1.txt    
   >    
   > > AndyJones_part2.txt    
   >    
   > >    
   >    
   > > David_part1.txt    
   >    
   > >    
   >    
   > > Hamilton_part2.txt    
   >    
   >    
   >    
   >    
   >    
   > What are you saying?   
   >    
   >    
   >    
   > Please explain.   
      
   --- 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