Log in

View Full Version : Using batch file to get content of a text file


ADLANCAS
11th September 2006, 23:43
After I read some documentations about batch files, I couldn't create a batch file that can put a content of four caracters from third caracter in the second line of a text file into a DOS variable.:(

To be clearer, if a test.txt file contents:
Here is the first line
123456789
Here is the third line
I'd like to get a variable _value in my test.bat that should contents:

_value = 3456

Until now, my incomplete batch file is only...
set _string=123456789
set _value=%_string:~2,4%

that results 3456 in variable _value. I need now to learn how to get a complete info from a text file.
(both files are in the same folder)

Ideas ?

ADLANCAS
13th September 2006, 03:48
Ok, I´ve got that!
An application with Aften ac3 encoder can be seen here:
http://forum.doom9.org/showthread.php?p=874922#post874922