- @echo off
- for /f %%i in ('sed -r "/产品名称b|产品b/!d; s/.*数量为?([0-9]+);?$/\1/" 1.txt') do (
- set /a numB+=%%i
- )
- echo 产品b一共: %numB%
- for /f %%i in ('sed -r "/产品名称c|产品c/!d; s/.*数量为?([0-9]+);?$/\1/" 1.txt') do (
- set /a numC+=%%i
- )
- echo 产品c一共: %numC%
- pause
复制代码
|