For loop in DOS Help

August 26, 2010 at 07:53:57
Specs: Windows XP, dualcore/2gb
for /f "tokens=* delims=<,>" %a in (subserror.txt) do SET MS=%%a
SET MSISDN=MS:~123,10
ECHO MS > adduserlist.txt

trying the script to write the 10 char after the 123rd char to seprate text from the each line of the text subserror.txt
which also contains strings like < and >.

Kindly help me. thanks in advacnce


See More: For loop in DOS Help

Report •

#1
August 26, 2010 at 10:03:59
Windows XP has NT COMMAND PROMPT CMD.EXE:

http://ss64.com/nt/syntax.html
http://ss64.com/nt/


Report •

#2
August 26, 2010 at 22:36:51
Thanks a lot for your guidance...

As i am new to batch ,could u help with my script


Report •

#3
August 27, 2010 at 03:18:35
Try this - untested.

@echo off
cls
setlocal enabledelayedexpansion

for /f "tokens=*" %%1 in (trial.txt) do (
    set ms=%%1&set msisdn=!ms:~123,10!
    >> adduser.txt echo !msisdn!
)


Report •

Related Solutions

#4
August 31, 2010 at 06:57:05
thanks yar will try

Report •

Ask Question