mirror of
https://github.com/tiennm99/MTTools.git
synced 2026-08-13 19:23:55 +00:00
feat: join.bat
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
# Utils
|
||||
|
||||
Useful (or useless) scripts to make life easier (or harder) :D
|
||||
|
||||
## `join.bat`
|
||||
|
||||
Join all text files from subfolders into combined files.
|
||||
|
||||
### Usage
|
||||
|
||||
1. Create an `input` folder in the same directory as the script
|
||||
2. Place your text files in subfolders within the `input` folder
|
||||
3. Run `join.bat`
|
||||
4. Find the combined files in the `output` folder
|
||||
@@ -0,0 +1,16 @@
|
||||
@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
if not exist output mkdir output
|
||||
|
||||
for /d %%D in (input\*) do (
|
||||
set "foldername=%%~nxD"
|
||||
if not exist "output\!foldername!.txt" type nul > "output\!foldername!.txt"
|
||||
|
||||
for %%F in ("%%D\*.txt") do (
|
||||
type "%%F" >> "output\!foldername!.txt"
|
||||
echo. >> "output\!foldername!.txt"
|
||||
)
|
||||
)
|
||||
|
||||
echo Process completed.
|
||||
Reference in New Issue
Block a user