1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Batch file that takes input from text file

Discussion in 'Software Development' started by MenakaB, Jan 4, 2014.

Thread Status:
Not open for further replies.
Advertisement
  1. MenakaB

    MenakaB Thread Starter

    Joined:
    Jan 4, 2014
    Messages:
    2
    Hi,

    I want to write a batch file to add the numbers. The inputs are in the text file. I need to add all the numbers in the text file that are in consequent lines. Please help me in doing that by giving an example.

    Regards,
    Menaka B
     
  2. Rollin_Again

    Rollin_Again

    Joined:
    Sep 4, 2003
    Messages:
    4,912
    Is there any particular reason you need this via batch? It will probably be much easier to accomplish using a VBS script instead.


    Rollin
     
  3. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,786
    Pretty easy in batch but that is my expertise.
    Why do you need to do this?
     
  4. MenakaB

    MenakaB Thread Starter

    Joined:
    Jan 4, 2014
    Messages:
    2
    Hi,

    Yes,I have a specific requirement for that. We will be running a batch process for that we will be reading the values from the text file.

    And I have another requirement like, for another batch file we will be giving the path of the specific text file, so that it will read the input from the file.please help in doing these two conditions.


    Thanks in Advance
    Menaka B
     
  5. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,786
    I need to see an example of what the numbers will look like in the text file and I also need to know if any of the numbers or the total could possibly be larger than a 32bit integer.
     
  6. loserOlimbs

    loserOlimbs

    Joined:
    Jun 19, 2004
    Messages:
    7,800
    @Rollin_Again:

    It is 2014, and I would encourage PowerShell before VBS or batch whenever possible. But that really my preference I guess.
     
  7. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1116749

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice