Microsoft
Software
Hardware
Network
Question : cmd FOR /f tokens 2* doesn't work
Morning gents,
Have trouble with a cmd string, which should work....
I need to find all text in file C:\zzsticker.txt after "L3= "
In the attached file there is a line: L3= Zebra ZM400
Below cmd lines would show only Zebra, and not token 3 !
For /F "tokens=2-3" %a in ( 'FIND /i "L3= " C:\zzsticker.txt' ) do set L3=%a
For /F "tokens=2*" %a in ( 'FIND /i "L3= " C:\zzsticker.txt' ) do set L3=%a
For /F "tokens=2,3" %a in ( 'FIND /i "L3= " C:\zzsticker.txt' ) do set L3=%a
or
For /F "tokens=2,3" %a in ( 'FIND /i "L3= " ^< C:\zzsticker.txt' ) do set L3=%a
Whats wrong ?
Attachments:
zzsticker.txt
(87 bytes)
(File Type Details)
file with the info to look for
Answer : cmd FOR /f tokens 2* doesn't work
Sorry, typo when copying and pasting.
That should have been
For /F "tokens=1*" %a in ( 'FIND /i "L3= " C:\zzsticker.txt' ) do set L3=%b
Random Solutions
dlookup with ' in the text does not work
Disable IMAP service in Exchange 2010 Certificate?!
Command:Click:Command is working fine for Button but its not working for Hyperlink
How do I recover from a XP pro reinstall power failure
Exchange 2007 Standby Continuous Replication
Changing Default Web Site Properties
Exchange 2010 EWS Virtual Directory
Binary data
AAA server not on inside interface
Computer restarted itself twice, event logs attached. Windows 7 Pro