Reputation: 107
I want to remove my last blank line of .txt file by using batch script. My last line will be always blank.
Upvotes: 3
Views: 14345
Reputation: 2790
using sed:
sed '$d' in
$ indicates the last line and d means to delete the matched pattern.
Upvotes: 3
Reputation: 79983
If your output file has only one blank line and by a blank line you mean an empty line - containing no characters then as a batch-file command:
for /f "delims=" %%i in (sqloutfile.txt) do >>newfile.txt echo %%i
Or from the prompt,
for /f "delims=" %i in (sqloutfile.txt) do >>newfile.txt echo %i
Upvotes: 0