Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I want to write a batch program to concatenate the number of files in Folder A (The number of files in Folder A may vary)
The suppose file 1 looks is:
Name Addr State Country
A B NJ US
C D CA USFile2 is
Name Addr State Country
E F NJ US
G H CA USThe desired Output file should look like
Name Addr State Country
A B NJ US
C D CA US
E F NJ US
G H CA US
I am new to batch programming Please need help with this.I understand copy command can be used to do this but the file name is
200807test.txt thenother file name will be 200809test.txt i.e. yyyymmtest.txt
Thanks In AdvanceThanks In Advance

Folder A may contain two files today but tommorow it may contain 3 or more files help me with this .
The approach I am following is first
calculate the number of files in the folder:
echo off
set count=0
CD%1
FOR %%i in (*%2) do set /A count+=1
cd ..
echo %count%
then I want to strip off the first line of each and then concatenate.the code for stripping the header is :
for /f "tokens=* skip=1" %%A in (%1) do ( echo %%A >> newfile-firstline-deleted.txt )
this works for one file I want to make it work for all the files in the folder as %1 would be the common text for the file name
can you please help me with this
Thanks In Advance

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |