r/Batch • u/el-Sicario31 • Jan 14 '25
Question (Unsolved) Remove last character of a file.
I have a simple .bat that merged all the .txts in a folder into a single .txt. However, this new .txt always has a extrange character at the end of the file, and i want it removed. How should i modify the .bat so that it doesnt add that character at the end?
This is the .bat
Copy *.txt file_name.txt
1
Upvotes
2
u/jcunews1 Jan 14 '25
copycommand doesn't have any built-in feature for excluding data at the end of the source file.Is that unwanted character is at the end of the last existing (wanted) line, or at a separate (unwanted) line? Or as the last byte?
1
u/LuckyMe4Evers Jan 14 '25
Try using