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,886 of 42,547    |
|    foxidrive to ehabaziz2001@gmail.com    |
|    Re: processing same files with same pref    |
|    14 Jan 14 22:42:41    |
   
   From: foxidrive@server.invalid   
      
   On 14/01/2014 22:33, ehabaziz2001@gmail.com wrote:   
   > 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 .   
   >   
      
   Do the files sort properly by filename?   
      
   --- 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