Computing.Net > Forums > Disk Operating System > get portion of the text string

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

get portion of the text string

Reply to Message Icon

Name: ronds7
Date: December 21, 2003 at 20:25:24 Pacific
OS: DOS
CPU/Ram: AMD 256MB
Comment:

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.




Sponsored Link
Ads by Google

Response Number 1
Name: dtech10
Date: December 29, 2003 at 17:33:55 Pacific
Reply:

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 21

r 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.


0
Reply to Message Icon

Related Posts

See More


Searching Subdirectories Cannot start DOS via OS L...



Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: get portion of the text string

Getting Contents of a Text File www.computing.net/answers/dos/getting-contents-of-a-text-file/13123.html

How Do I Pause The Viewing Of A Text File While In Pure DOS? www.computing.net/answers/dos/how-do-i-pause-the-viewing-of-a-text-file-while-in-pure-dos/5421.html

Extract part of a text line www.computing.net/answers/dos/extract-part-of-a-text-line/13978.html