General discussion

Locked

Batch File for grouping files

By barberd99 ·
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.

0 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Back to Storage Forum
0 total posts (Page 1 of 1)  

Related Discussions

Related Forums