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,888 of 42,547    |
|    ehabaziz2001@gmail.com to All    |
|    processing same files with same prefix    |
|    14 Jan 14 03:33:45    |
   
   I have a directory that containing files that may or may not contain the same   
   prefix like this :   
      
   xxx_part1.txt   
   xxx_part2.txt   
   yyy_part1.txt   
   yyy_part2.txt   
   zzz_part1.txt   
   zzz_part2.txt   
   aaa_part1.txt   
   bbb_part1.txt   
      
   I need to run a concatenate file commands per each paris like this:   
   copy /b xxx_conc.txt+xxx_part1.txt+xxx_part2.txt   
   copy /b yyy_conc.txt+yyy_part1.txt+yyy_part2.txt   
      
      
   How can I perform this task using for loop. The separator per each prefix is   
   the underscore.   
      
   for /F "tokens=*" %%* in ('dir /b *.RPT') do (   
   copy /b %source2%\%N%_conc.txt+"%%*"   
   )   
      
   Thanks in advance .   
      
   --- 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