Computing.Net > Forums > Disk Operating System > windows 98 batch file

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.

windows 98 batch file

Reply to Message Icon

Name: pswauger
Date: April 6, 2005 at 11:37:39 Pacific
OS: Windows 98
CPU/Ram: P4 512MB
Comment:

I am trying to capture the first word of a text file to a variable. I can do it fine in Windows NT, but cant seem to get it in Windows 98. I am using some third party utilities to try to do this (sed.exe and sv2.exe). This is what i have so far, but I cant get it to work

sed -n 1p folder~1.txt|sed "s/^ *//;s/ .*$//">fname.txt
type fname.txt|s2v lname

Any assistance would be extremely helpful.
Thanks.




Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: April 6, 2005 at 12:21:36 Pacific
Reply:

Hi Pete,

Get the prefix utility here:

http://www.golden.triangle.com/PREFIX.ZIP

and use this BAT:

::**
@echo off > quit.bat

prefix "setter " < myfile.txt > my.bat

> setter.bat echo set MYvar=%%1

my
::**

HTH

M2


If at first you don't succeed, you're about average.


0

Response Number 2
Name: pswauger
Date: April 6, 2005 at 16:23:48 Pacific
Reply:

I cant get this to work.


0

Response Number 3
Name: Mechanix2Go
Date: April 6, 2005 at 22:39:49 Pacific
Reply:

What does it do?

Or what does it not do?

M2


If at first you don't succeed, you're about average.


0

Response Number 4
Name: dtech10
Date: April 8, 2005 at 09:28:56 Pacific
Reply:

Hi Pete
You seem to be having a problem getting the first word of a text file.
I do'nt know why the existing programs do'nt work.
I could write a C program to do this, but if you want a batch file for Win98 to do this it alot more difficult to write.

Whats in the text file? there's no ":" ">" and "<" charactors that may cause problems.
Is the text seperated by spaces or is it the only word on the first line.

What name do you want for the Environment Variable.


0

Response Number 5
Name: pswauger
Date: April 8, 2005 at 13:01:25 Pacific
Reply:

I found a different utility to do it with. XSet.exe


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






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: windows 98 batch file

Closing Window after Batch file is complete www.computing.net/answers/dos/closing-window-after-batch-file-is-complete/1778.html

Help batch file programming www.computing.net/answers/dos/help-batch-file-programming/14554.html

Syntax for a OS batch file www.computing.net/answers/dos/syntax-for-a-os-batch-file-/11670.html