Solved Remove blank space char(s) on lines on text file

October 31, 2012 at 04:32:23
Specs: Windows Server 2008 R 2 standard 64bit
Hi All,
Please help.
I need advice to remove blank space char(s) on my text file.space(s) are 2-5 digit at end of line (20,space space or 20,space space space space space)
example :
AND-TTY,2012/08/01210212,20.20120812,10,432434.00,20,
AND-TTY,2012/08/01210212,20.20120813,10,432434.00,20,
AND-TTY,2012/08/01210212,20.20120814,10,432434.00,20,
AND-TTY,2012/08/01210212,20.20120815,10,432434.00,20,
AND-TTY,2012/08/01210212,20.20120816,10,432434.00,20,
after ,20, (at end of line) it will have 2-5 blank space.
Please advice, what script to remove the blank space of end of line.
Thanks
Alex

See More: Remove blank space char(s) on lines on text file

Report •


#1
October 31, 2012 at 08:14:45
✔ Best Answer
SETLOCAL EnableDelayedExpansion
for /f "tokens=1 delims=" %%g IN (c:\test.txt) DO set str=%%g & set str=!str: =! & echo !str!>>test2.txt

:: mike


Report •
Related Solutions


Ask Question