Computing.Net > Forums > Disk Operating System > arithmetic 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.

arithmetic batch file

Reply to Message Icon

Name: Brian Curran
Date: January 4, 1999 at 13:34:10 Pacific
Comment:

I need to create a batch file which will input numerical data from a file and perorm some mathematical operations, then send it to another file. I am new at batch files and have not found anything to do with arithmetic manipulation of data. If anyone can help, thanks a bunch.



Sponsored Link
Ads by Google

Response Number 1
Name: Justin Shriver
Date: January 10, 1999 at 10:53:50 Pacific
Reply:

Batch files, in dos, are pretty limited. There are two approachs people have used. One is to create text stacks and push and pot things from them. The second is to actually write a little assembler program to handle the job. I think you can find some of these at PCmag's web cite.


0

Response Number 2
Name: Outsider
Date: March 15, 1999 at 01:08:18 Pacific
Reply:

This was recently posted at
alt.msdos.batch and it works great!
:::::::::::::::::::::::::::::::::::::::::
:: CAL.BAT
::
:: Syntax : CAL [env.var.=] Calculation
::
:: e.g.: CAL test=3*4+7*12
:: (Result is stored in the EnvironmentVariable TEST)
::
:: or : CAL 4*(42+7)*12
:: (Result is displayed on the screen, not stored)
::
:: Referencing an Environment-Variable is possible not only
:: within a batch but also from the command line:
:: e.g.: CAL test=2+7
:: CAL xx=sin(%test%)+25*3
::
:: Note: - needs QBASIC
:: - NO spaces within the "calculation" term!
:: - within a batch use: CALL CAL [env.var.=] Calculation
::
:: Edwin Schwartz, 03/1995
::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
echo set d1=%1> {cal}.bat
echo set d2=%2>> {cal}.bat
:: THERE must be NO spaces before the ">" and ">>"
:: in the above lines !!
call {cal}.bat
if %2*==* echo ?"echo "+ltrim$(str$(1!*%d1%)) >> {cal}.bas
if not %2*==* echo ?"set %d1%="+ltrim$(str$(1!*%d2%)) >> {cal}.bas
echo ?a$:?"set d1=":?"set d2=":system >> {cal}.bas
QBASIC /b/run {cal} > {cal}.bat
call {cal}.bat
for %%f in (s t) do del {cal}.ba%%f



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: arithmetic batch file

Math in Batch File www.computing.net/answers/dos/math-in-batch-file/13315.html

Help!! Batch File www.computing.net/answers/dos/help-batch-file/13525.html

Batch files - - Mapping network drive www.computing.net/answers/dos/batch-files-mapping-network-drive/3809.html