OK, so I have a text file and for some idiotic reason the last carriage return needs to be removed...
Please see test_bad and test_good attachments for the general idea, if you dont get it allready.
I can find plenty of scripts to remove empty lines, i.e.
or
However I cannot seem to find a way to remove the last line in the file, my guess is I want to 'simply' remove the last carriage return and I can think of ways to do it in VBA, but this needs to be done in the command line
Anyone have any clue?
Please see test_bad and test_good attachments for the general idea, if you dont get it allready.
I can find plenty of scripts to remove empty lines, i.e.
Code:
@ECHO OFF
FOR /F "usebackq delims=" %%a in ("test.txt") DO (
ECHO.%%a
)
or
Code:
Findstr /v ^^$ test.txt > test_clean.txt
Anyone have any clue?