SoFunction
Updated on 2025-03-09

Batch bat code outputs the data in text

As the title is as follows:

120*80*4000=25
120*80*4000=10
120*80*4000=50
60*80*3000=12
60*80*3000=6
Can you output 120*80*4000=85
60*80*3000=18 to ?

Implement code

@echo off
for /f "tokens=1-4 delims=*=" %%i in () do (
    set /a "_%%i_%%j_%%k+=%%l"
)
(for /f "tokens=1-3 delims=_" %%i in ('set _') do (
    echo %%i*%%j*%%k
))>

There are examples in the help documentation:

SET P
It will display all

Variables beginning with letter P