Computing.Net > Forums > Programming > Read 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.

Read txt-file

Reply to Message Icon

Name: Nokan
Date: October 7, 2005 at 04:17:26 Pacific
OS: win XP
CPU/Ram: 1,6 / 512
Comment:

Hi
Anyone who knows how to make an easy bat-file for reading a single line number from a txt-file, then add 1 to this number and write it back to the txt-file.
/Samuel



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: October 7, 2005 at 05:44:14 Pacific
Reply:

Your post is not clear about the format of the text file. If it has one line holding the number, the following does the trick

@Echo Off

Set /P Num=<%1
Set /A Num+=1
Echo %Num%>%1

To run (assumed the batch is named Add.bat) just type Add File_Name (e.g. Add Num.txt).


0
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 Programming Forum Home


Sponsored links

Ads by Google


Results for: Read txt-file

Read a txt file in Vb www.computing.net/answers/programming/read-a-txt-file-in-vb/7871.html

Read vaiable from txt file www.computing.net/answers/programming/read-vaiable-from-txt-file/19350.html

Read and write txt files online www.computing.net/answers/programming/read-and-write-txt-files-online/19406.html