Answer the question
In order to leave comments, you need to log in
How to combine all txt in one folder into 1 file, while cleaning the contents of all txt without deleting the files themselves?
Hello!
How to combine all txt in one folder into 1 file, while cleaning the contents (all txt) without deleting the files themselves?
Perhaps a batch file or a script will help.
Thanks:)
Answer the question
In order to leave comments, you need to log in
Let's say these files are in the dir directory. Then the command code (for Linux) will be:
find dir -name "*.txt" -exec sh -c 'cat \{} >> t.txt && :>\{}' \;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question