给楼主解决问题了, 测试通过- (
- @echo off
- for /f "tokens=1,2 delims=," %%a in (1.txt) do set val_%%a=%%b
- for /f "tokens=1,2 delims=," %%a in (2.txt) do (
- if defined val_%%a (
- call set/a sum_=%%b "*" %%val_%%a%%
- call set/a sumAll+=%%sum_%%
- call echo %%a, %%b, %%val_%%a%%, %%sum_%%
- ) else (
- set No_%%a=%%a, %%b
- ))
-
- echo.
- call echo 总价: %%sumAll%%
- echo ................................................
- echo 下面是没有价格的东西:
- for /f "tokens=2 delims==" %%a in ('set No_') do echo %%a
- )>>3.txt
复制代码
|