Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Can anybody help me get portion of the text string inside the file?
For Ex: FILENAME.EXT
1234WEEK01120603;I would like to get the 120603 from the content of the file and set a variable. How would I create the script?
Thanks in advance.

Hi Ron
Try this, you need to create oneline.com yourself and download varset.com from http://home.mnet-online.de/horst.muc/
Type this into a text file and name it oneline.scr
Note the blank line is a carriage return.
---------------
n oneline.com
a 100
mov ah,2
mov si,82
mov,dl,[si]
cmp dl,d
jz 113
mov ah,2
int 21
inc si
jmp 105
mov ah,4c
int 21r cx
17
w
q
---------------
rem Create oneline.com
debug < oneline.scr
---------------
Download varset.com from http://home.mnet-online.de/horst.muc/
Store online.com and varset.com in current directory or in your path, and run the batch file below.
Change environment variables names as you wish.
---------------
@echo off
oneline set x=>tmp.bat
type t.txt >>tmp.bat
call tmp.bat
varset xx=string(11,6) %x% >tmp.bat
call tmp.bat
echo %x%
echo %xx%
---------------Any problems let me know.

![]() |
Searching Subdirectories
|
Cannot start DOS via OS L...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |