Welcome to Dream.In.Code
Click Here
Getting Help is Easy!

Join 118,309 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,698 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Reading in line from Text File

 
Reply to this topicStart new topic

Reading in line from Text File, Batch File that reads in line from text file

mrstick
post 30 Jul, 2008 - 08:58 AM
Post #1


New D.I.C Head

*
Joined: 30 Jun, 2008
Posts: 2

Hi,

Not sure if this belongs in this area but hopefully you can help. I am writing today's date to a text file. For example, "20082907"

When I read it in from my script, it reads it as "20082907 " < There is an extra space.

Here is the code I am writing and reading.

Code that Writes to yesterday.txt:
CODE

For /f "tokens=2-4 delims=/ " %%a in ('date /t') do set date=%%c%%b%%a
echo %date% > yesterday.txt



Code that Reads from text file yesterday.txt
CODE

set /p yesterdaysdate= <yesterday.txt



I do not want this extra space. Any help would be much appreciated. Thanks
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/10/08 11:48AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month