Hi all, I need a batch file to take the text from seveal test*txt (* being a variable number)files and group it in one file result.text, but also add part of the file name (the variable number)to each line! i.e. file 1 text354.txt and contains ROW,partno1,1,01/03/2010 file 2 text654.txt and contains ROW,partno2,7,01/03/2010 ROW,partno3,5,01/03/2010
-so far I have got this -@echo off>Group Files - -cd\ -cd test\files -for /r /d %%a in (.) do copy/b test.txt+"test*.txt" test.txt -exit
this copies across the lines but replicates them! what am i doing wrong and how do I get the file name variable into the result file on each line i.e. result.txt ROW,partno1,1,01/03/2010,354 ROW,partno2,7,01/03/2010,654 ROW,partno3,5,01/03/2010,654 I would appreciate any help you can give on this please
This conversation is currently closed to new comments.
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
Batch File for grouping files
i.e. file 1 text354.txt and contains ROW,partno1,1,01/03/2010
file 2 text654.txt and contains ROW,partno2,7,01/03/2010
ROW,partno3,5,01/03/2010
-so far I have got this
-@echo off>Group Files
-
-cd\
-cd test\files
-for /r /d %%a in (.) do copy/b
test.txt+"test*.txt" test.txt
-exit
this copies across the lines but replicates them! what am i doing wrong and how do I get the file name variable into the result file on each line
i.e. result.txt
ROW,partno1,1,01/03/2010,354
ROW,partno2,7,01/03/2010,654
ROW,partno3,5,01/03/2010,654
I would appreciate any help you can give on this please