Computing.Net > Forums > Disk Operating System > How to read data from txt 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.

How to read data from txt file

Reply to Message Icon

Name: learner
Date: October 30, 2003 at 04:08:10 Pacific
OS: win nt
CPU/Ram: na
Comment:

Hi

I have stored a date value in a txt (currdate.txt) and it contains only this single line data as '20031030'.

Now how do i read this data and store it to a variable which i need to use to check a condition?

thanks for your kind help

cheers



Sponsored Link
Ads by Google

Response Number 1
Name: bitbyte
Date: October 30, 2003 at 12:24:43 Pacific
Reply:

try this

@echo off
for /f "tokens=1" %%a in ('more a.txt') do set checkdate=%%a
echo %checkdate%


0

Response Number 2
Name: learner
Date: October 30, 2003 at 18:55:01 Pacific
Reply:

Hi

Thanks a lot! it works!!!

except for, more command, I had to change it to 'type a.txt'. Looks like more does not work. It returns an error message 'too many arugments'.

We a re currently using Win NT 4.0.

thanks one again for your prompt response

cheers


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







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: How to read data from txt file

Read in from text file www.computing.net/answers/dos/read-in-from-text-file/10895.html

how to retreave data from a laptop www.computing.net/answers/dos/how-to-retreave-data-from-a-laptop/14718.html

How to read sth from registry www.computing.net/answers/dos/how-to-read-sth-from-registry/14783.html