for /f replace text

June 20, 2011 at 06:56:06
Specs: Windows XP
hi everyone,
belows my script
FOR /F "tokens=2 delims==}" %%A IN (xy.txt) DO @echo %%A
here's the xy.txt text
probs is only one instance of write happens n thats wrong = 32,Y
can someone resolve the mystery ive tried the delims back approach }= but no luck.

See More: for /f replace text

Report •

June 20, 2011 at 09:27:08
What do you want to get as result of parsing?

Setting "tokens=2 delims==}" catches just 32,Y since


1- {X
2- 32,Y
3- 62

and so on since your delimiters are = and } and they are not reported in the selected tokens.

Report •

June 20, 2011 at 09:41:00
hi ivo, -3 62 is the desired no' for all enclosed in {} i dnt fully get ur drift since this problems batterd me 4 days in vb too.
to tell the truth im fairly new r u saying i need to list more tokens?
because im only after the 1 value from each brace set.
baring in mind =} is not the same == or {=
could you elaborate

Report •

June 20, 2011 at 10:18:55
ivo could u update
as far as i know with delims =} theres two possible outcomes and (N),(N,Y=N) wheres cmd getting N,y thats equivilant of setting delims to ==" could you update because logically theres two tokens and im choosing the second to work with

Report •

Related Solutions

June 21, 2011 at 03:18:47
Setting "tokens=3 delims==}" catches 62 since the string is tokenized as below

1  2    3  4  and so on...

You have probably to enforce your knowledge about FOR /F tokens.

Report •

June 22, 2011 at 14:01:08
No ivo its delims which was the problem thrown in with lack of sleep

Clearly i had presumed delims was not wildcarding and for anyone new to delims would stumble, off course with ur knowledge u would notice the mistake straight away.

Nice to see the update though,... ur really like the shepard round here
i hope one day to be as good if not better.

Report •

Ask Question