If the character are not position specific, you can use external command FIND
For example: find "123" Ifile > Ofile
If the character are not case sensitive you can use /i paramater
For example: find/i "abc" Ifile > Ofile
will find the line that contain "abc" "ABC" "Abc" "ABc" ......
If you need the character are position specific, I recommend you use 4DOS as command interpreter (the 4DOS 7.50 is freeware now,you can download it from official website
http://www.jpsoft.com or
ftp://jpsoft.com. and should be used in DOS and Win9X environment)
you can use its' Variable Function @INSTR
usage:
@INSTR: Returns a substring, starting at the position start and continuing for length characters. If the length is omitted, it will default to the remainder of the string. If the length is negative, the start is relative to the right side of the string. The first character in the string is numbered 0; if the length is negative, the last character is numbered 0.
For example, %@INSTR gets the current time and extracts the
hour; %@INSTR extracts the seconds. If the string includes
commas, it must be quoted with double quotes or back-quotes . The
quotes do count in calculating the position of the substring.
If your record of Ifile are left aligned on each line, you try do this
for %f in (@Ifile) do if %@INSTR==123 echo %f >>Ofile