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,895 of 42,547    |
|    ehabaziz2001@gmail.com to All    |
|    Re: processing same files with same pref    |
|    15 Jan 14 14:46:22    |
   
   The pairs are like each other :   
   files like this :   
      
   ehab_part1.txt   
   ehab_part2.txt   
      
   AndyJones_part1.txt   
   AndyJones_part2.txt   
      
   I need to concatenate each pair in one file ,   
   Thanks   
      
   بتاريخ الأربعاء، 15 يناير، 2014 UTC+2 4:26:21 ص، كتب   
   Todd Vargo:   
   > On 1/14/2014 7:45 AM, ehabaziz2001@gmail.com wrote:   
   >    
   > > بتاريخ الثلاثاء، 14 يناير، 2014 UTC+2 1:33:45 م،   
   كتب ehabaz...@gmail.com:   
   >    
   > >> 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 .   
   >    
   > >   
   >    
   > > set n=%n:~0,-6%   
   >    
   > >   
   >    
   > > The position 6 is not fixed xxx could be xxxx or xx , but the separator   
   (_) after the name prefix is fixed.   
   >    
   >    
   >    
   > So now you want to concatenate like this too?   
   >    
   >    
   >    
   > copy /b xxx_conc.txt+xxxx_part1.txt+xx_part2.txt   
   >    
   >    
   >    
   > Does the prefix actually contain the same characters like xx, xxx, xxxx    
   >    
   > or does this represent random strings of numbers. Please provide a    
   >    
   > broader set of real prefix examples.   
   >    
   >    
   >    
   > PS: this will be my last response if I see more double spaced lines.    
   >    
   > Continue to use Google at your own peril.   
   >    
   >    
   >    
   > --    
   >    
   > Todd Vargo   
   >    
   > (Post questions to group only. Remove "z" to email personal messages)   
      
   --- 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