Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
doscode
- Posts: 175
- Joined: 15 Feb 2012 14:02
#1
Post
by doscode » 22 May 2012 12:50
Hello,
can I use pipeline in for loop?
Code: Select all
FOR /F "tokens=1 delims=" %R IN ('convert "file2.bmp" -crop 300x100+340+400 -fuzz 5% -fill black +opaque #660000 -fill white -opaque #660000 txt:- | grep white') DO ( echo %R )
Error: | not expected.
-
Aacini
- Expert
- Posts: 1932
- Joined: 06 Dec 2011 22:15
- Location: México City, México
-
Contact:
#2
Post
by Aacini » 22 May 2012 13:04
Just escape the pipeline with a caret:
Code: Select all
FOR /F "tokens=1 delims=" %R IN ('convert "file2.bmp" -crop 300x100+340+400 -fuzz 5% -fill black +opaque #660000 -fill white -opaque #660000 txt:- ^| grep white') DO ( echo %R )
-
Squashman
- Expert
- Posts: 4488
- Joined: 23 Dec 2011 13:59
#4
Post
by Squashman » 22 May 2012 19:35
All you had to do was look at the previous thread you started and looked at the script that was written for you.