There is a file b.txt whose contents are: aa3vv4bb34cc4dd34ff
I want to use “34” as the delimiter string and extract the strings:
-----------------------------------------
@echo off
for /f "delims=34 tokens=1,2,3*" %%i in (b.txt) do (
echo %%i---%%j---%%k
)
pause
-----------------------------------------
Originally I wanted to use “34” as a delimiter string, so that after processing it would output “aa3vv4bb--cc4dd--ff”, but when the batch file runs it does not treat “34” as a whole, so I did not get the result I wanted (it outputs “aa---vv---bb”). Is there any simple way to do this?
[ Last edited by abxialiang on 2010-3-8 at 12:10 ]
I want to use “34” as the delimiter string and extract the strings:
-----------------------------------------
@echo off
for /f "delims=34 tokens=1,2,3*" %%i in (b.txt) do (
echo %%i---%%j---%%k
)
pause
-----------------------------------------
Originally I wanted to use “34” as a delimiter string, so that after processing it would output “aa3vv4bb--cc4dd--ff”, but when the batch file runs it does not treat “34” as a whole, so I did not get the result I wanted (it outputs “aa---vv---bb”). Is there any simple way to do this?
[ Last edited by abxialiang on 2010-3-8 at 12:10 ]

