How you can read a file (text or binary) from a batch file? There is a way to read it in a binary mode or text mode?
A:
Why would you possibly want to? What goal are you trying to accomplish? If you want to simply look for a string in a file use FindStr. If you want to do anything much more complicated than that, I would strongly suggest not using a bat.
EBGreen
2008-10-15 19:40:54
I just want to know if this is posible
unkiwii
2008-10-15 19:42:19
Oh, and you are right. If ANYONE want to do something complicated with a file i also recommend not to use a bat. This is experimental and to make some funny things DO NOT TRY THIS AT HOME! :)
unkiwii
2008-10-15 19:49:44
+9
A:
Under NT-style cmd.exe, you can loop through the lines of a text file with
FOR /F %i IN (file.txt) DO @echo %i
Type "help for" on the command prompt for more information. (don't know if that works in whatever "DOS" you are using)
devio
2008-10-15 19:45:02
+6
A:
You can use the for command:
FOR /F "eol=; tokens=2,3* delims=, " %i in (myfile.txt) do @echo %i %j %k
Type
for /?
at the command prompt. Also, you can parse ini files!
johnstok
2008-10-15 19:47:00
A:
Reading and writing in binary is possible, but that will get ugly.
Coding With Style
2009-07-11 05:01:56