简体   繁体   中英

Batch File that merges text files

I have a newbie question about batch files.

I have a CNC post that only lets me post one tool at a time.

I would like to have a batch file that merges all the text files in the post and puts them into one text file

the programmer can name the files 1001, 1002, 1003, 1004

then the batch file places 1002,1003,1004 into 1001

I would like it to delete the first 20 lines of 1002,1003,1004 as it will already be in the post 1001.

please let me know if this is doable or not

much appreciated!!!

-Aaron

:: Read text 
set /p text1=<1001.txt
set /p text2=<1002.txt
set /p text3=<1003.txt
set /p text4=<1004.txt

:: Merge the text
echo %text1% >merged_text.txt
echo %text2% >>merged_text.txt
echo %text3% >>merged_text.txt
echo %text4% >>merged_text.txt

:: Display the merged text
type merged_text.txt

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM