Remove weird rectangle at end of line

Acer Aspire 5920g
August 15, 2010 at 00:37:19
Specs: Microsoft Windows 7 Professional, 2.201 GHz / 2046 MB
Hello guys i ran the code to remove spaces for the ipconfig command and i met this problem whereby theres an invisible rectangle after .134..i am wondering how to solve this..thanks in advance:)


Result:
IPAddress............:192.168.199.134[]-< weird rectangle


Code:
SETLOCAL EnableDelayedExpansion
IPCONFIG | findstr /C:"IP Address" >> IPCONFIG.txt


for /f "delims=" %%a in (IPCONFIG.txt) do (
set line=%%a
set line=!line: =!
!
echo !line! >> IPCONFIGNS.txt
)

FOR /f "tokens=2 delims=:" %%a IN (IPCONFIGNS.txt) DO (
SET IP=%%a
)


See More: Remove weird rectangle at end of line

Report •


#1
August 15, 2010 at 05:32:11
Suggestion:
for /f "tokens=15" %%a in ('ipconfig ^| findstr "Address"') do @echo %%a


Report •

#2
August 15, 2010 at 07:17:18
ahh Razor..it still gives me that weird rectangle man..

Report •

#3
August 15, 2010 at 07:36:25
If I remember correctly it's a surplus CR(0x0Dh), you can get rid of it by using:

set line=!line:0,-1!

or

call :sub !line!
goto :eof

:sub
set line=%1
goto :eof


Report •

Related Solutions


Ask Question