- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
几年前,@ Mofi帮助我创建了一个了不起的.bat
脚本,用于对许多内容的值求和,还加入了它们的名称并对其求和。
请检查有关它的旧答案,并以Mofi的答案为重点。
How to ignore first and third data column on sorting and summing the text using batch file?
但是我注意到一个问题。
.txt
文件进行重新格式化:
04 VERO BANRICOMPRAS A PRAZO 651326 885,92
VERO BANRICOMPRAS A VISTA 038937 470,90
VERO CARTAO CREDITO 100810 2.126,17
VERO CARTAO CREDITO 100811 1.354,05
VERO CARTAO CREDITO 100812 148,91
CIELO S/A CARTAO CREDITO 084036 45,75
CIELO S/A CARTAO CREDITO 084037 24,18
CIELO S/A CARTAO CREDITO 084038 108,34
REDECARD S.A CARTAO CREDITO 154346 163,81
VERO CARTAO DEBITO 214591 1.338,66
VERO CARTAO DEBITO 214592 556,16
VERO CARTAO DEBITO 214593 113,96
CIELO S/A CARTAO DEBITO 186651 491,87
CIELO S/A CARTAO DEBITO 186652 678,53
05 VERO BANRICOMPRAS A PRAZO 976373 504,55
VERO BANRICOMPRAS A VISTA 440325 397,56
VERO CARTAO CREDITO 496411 725,69
VERO CARTAO CREDITO 496412 545,53
CIELO S/A CARTAO CREDITO 488259 135,32
CIELO S/A CARTAO CREDITO 488260 33,72
REDECARD S.A CARTAO CREDITO 519807 22,81
VERO CARTAO DEBITO 555957 619,03
VERO CARTAO DEBITO 555958 452,29
CIELO S/A CARTAO DEBITO 542472 946,15
06 VERO BANRICOMPRAS A PRAZO 419616 257,17
VERO BANRICOMPRAS A VISTA 771632 379,49
VERO CARTAO CREDITO 818228 1.317,35
VERO CARTAO CREDITO 818229 708,32
VERO CARTAO CREDITO 818230 84,28
CIELO S/A CARTAO CREDITO 809536 14,88
REDECARD S.A CARTAO CREDITO 846159 51,57
VERO CARTAO DEBITO 883969 229,31
VERO CARTAO DEBITO 883970 85,83
CIELO S/A CARTAO DEBITO 870136 49,18
CIELO S/A CARTAO DEBITO 870137 42,28
RESGATE AUTOMATICO 000000 6.200,00
07 VERO BANRICOMPRAS A PRAZO 742635 148,84
VERO BANRICOMPRAS A VISTA 135047 111,52
VERO CARTAO CREDITO 178947 867,82
VERO CARTAO CREDITO 178948 41,02
CIELO S/A CARTAO CREDITO 169813 133,68
CIELO S/A CARTAO CREDITO 169814 24,98
VERO CARTAO DEBITO 244107 596,02
VERO CARTAO DEBITO 244108 364,95
CIELO S/A CARTAO DEBITO 229583 651,76
08 VERO BANRICOMPRAS A PRAZO 085581 274,00
VERO BANRICOMPRAS A VISTA 489251 950,36
VERO CARTAO CREDITO 532717 601,15
VERO CARTAO CREDITO 532718 488,93
CIELO S/A CARTAO CREDITO 523033 69,76
CIELO S/A CARTAO CREDITO 523034 58,36
CIELO S/A CARTAO CREDITO 523035 34,30
REDECARD S.A CARTAO CREDITO 562700 185,53
VERO CARTAO DEBITO 603103 2.608,68
VERO CARTAO DEBITO 603104 1.124,42
CIELO S/A CARTAO DEBITO 588005 1.419,60
11 VERO BANRICOMPRAS A PRAZO 451443 770,43
VERO BANRICOMPRAS A VISTA 800736 1.377,51
VERO CARTAO CREDITO 859775 1.673,38
VERO CARTAO CREDITO 859776 836,50
VERO CARTAO CREDITO 859777 27,42
VERO CARTAO CREDITO 859778 39,24
CIELO S/A CARTAO CREDITO 844066 26,44
CIELO S/A CARTAO CREDITO 844067 45,37
CIELO S/A CARTAO CREDITO 844068 54,34
REDECARD S.A CARTAO CREDITO 910400 127,17
VERO CARTAO DEBITO 972748 3.560,31
VERO CARTAO DEBITO 972749 1.939,33
CIELO S/A CARTAO DEBITO 944629 175,81
CIELO S/A CARTAO DEBITO 944630 2.161,99
CIELO S/A CARTAO DEBITO 944631 58,72
CIELO S/A CARTAO DEBITO 944632 1.559,94
RESGATE AUTOMATICO 000000 15.500,00
12 VERO BANRICOMPRAS A PRAZO 742222 159,97
VERO BANRICOMPRAS A VISTA 190951 1.247,06
VERO CARTAO CREDITO 334660 669,75
VERO CARTAO CREDITO 334661 263,14
VERO CARTAO CREDITO 334662 99,13
CIELO S/A CARTAO CREDITO 325837 17,40
CIELO S/A CARTAO CREDITO 325838 161,58
REDECARD S.A CARTAO CREDITO 358417 106,89
VERO CARTAO DEBITO 394014 128,39
VERO CARTAO DEBITO 394015 349,08
CIELO S/A CARTAO DEBITO 381003 892,94
RESGATE AUTOMATICO 000000 6.900,00
DEVOLUCAO DOC. ELETRONICO 000060 3.949,49
13 VERO BANRICOMPRAS A PRAZO 147127 136,58
VERO BANRICOMPRAS A VISTA 564315 225,14
VERO CARTAO CREDITO 917004 656,04
VERO CARTAO CREDITO 917005 84,70
VERO CARTAO CREDITO 917006 103,07
CIELO S/A CARTAO CREDITO 907873 190,28
CIELO S/A CARTAO CREDITO 907874 65,24
REDECARD S.A CARTAO CREDITO 945528 155,34
VERO CARTAO DEBITO 981014 488,95
VERO CARTAO DEBITO 981015 112,82
14 VERO BANRICOMPRAS A PRAZO 534959 19,21
VERO BANRICOMPRAS A VISTA 123609 343,33
VERO CARTAO CREDITO 174070 225,84
VERO CARTAO CREDITO 174071 237,41
CIELO S/A CARTAO CREDITO 164650 40,68
CIELO S/A CARTAO CREDITO 164651 26,54
VERO CARTAO DEBITO 237408 608,63
VERO CARTAO DEBITO 237409 1.061,97
CIELO S/A CARTAO DEBITO 224104 232,16
15 VERO BANRICOMPRAS A PRAZO 091718 212,73
VERO BANRICOMPRAS A VISTA 412318 528,61
VERO CARTAO CREDITO 464462 1.255,15
VERO CARTAO CREDITO 464463 82,57
VERO CARTAO CREDITO 464464 72,84
CIELO S/A CARTAO CREDITO 454334 25,47
CIELO S/A CARTAO CREDITO 454335 204,90
CIELO S/A CARTAO CREDITO 454336 218,38
REDECARD S.A CARTAO CREDITO 495065 81,70
VERO CARTAO DEBITO 532669 340,94
VERO CARTAO DEBITO 532670 63,15
CIELO S/A CARTAO DEBITO 518884 699,42
18 VERO BANRICOMPRAS A PRAZO 383614 691,40
VERO BANRICOMPRAS A VISTA 719756 955,41
VERO CARTAO CREDITO 766119 3.335,37
VERO CARTAO CREDITO 766120 1.460,17
VERO CARTAO CREDITO 766121 637,74
CIELO S/A CARTAO CREDITO 749384 185,38
REDECARD S.A CARTAO CREDITO 818055 341,85
VERO CARTAO DEBITO 876849 1.686,83
VERO CARTAO DEBITO 876850 623,29
VERO CARTAO DEBITO 876851 24,33
CIELO S/A CARTAO DEBITO 852038 157,38
CIELO S/A CARTAO DEBITO 852039 892,36
CIELO S/A CARTAO DEBITO 852040 818,90
19 VERO BANRICOMPRAS A PRAZO 660866 118,53
VERO BANRICOMPRAS A VISTA 080453 244,18
VERO CARTAO CREDITO 126719 533,66
VERO CARTAO CREDITO 126720 95,94
VERO CARTAO CREDITO 126721 47,87
CIELO S/A CARTAO CREDITO 118299 46,64
CIELO S/A CARTAO CREDITO 118300 137,53
REDECARD S.A CARTAO CREDITO 149953 27,27
VERO CARTAO DEBITO 184851 1.325,03
VERO CARTAO DEBITO 184852 511,96
CIELO S/A CARTAO DEBITO 171809 437,77
20 VERO BANRICOMPRAS A PRAZO 044755 415,29
VERO BANRICOMPRAS A VISTA 349028 493,91
VERO CARTAO CREDITO 403626 673,75
VERO CARTAO CREDITO 403627 342,59
VERO CARTAO CREDITO 403628 58,28
REDECARD S.A CARTAO CREDITO 433775 67,90
REDECARD S.A CARTAO CREDITO 433776 67,61
VERO CARTAO DEBITO 472002 297,51
VERO CARTAO DEBITO 472003 131,56
RESGATE AUTOMATICO 000000 9.700,00
21 VERO BANRICOMPRAS A PRAZO 319063 305,54
VERO BANRICOMPRAS A VISTA 679182 473,10
VERO CARTAO CREDITO 724092 594,46
VERO CARTAO CREDITO 724093 290,86
CIELO S/A CARTAO CREDITO 716700 133,04
CIELO S/A CARTAO CREDITO 716701 244,63
REDECARD S.A CARTAO CREDITO 744273 109,34
VERO CARTAO DEBITO 779495 461,80
VERO CARTAO DEBITO 779496 61,27
CIELO S/A CARTAO DEBITO 765528 1.369,41
22 VERO BANRICOMPRAS A PRAZO 625121 272,86
VERO BANRICOMPRAS A VISTA 947266 173,69
VERO CARTAO CREDITO 049605 794,90
VERO CARTAO CREDITO 049606 181,81
VERO CARTAO CREDITO 049607 123,49
CIELO S/A CARTAO CREDITO 040363 115,22
CIELO S/A CARTAO CREDITO 040364 21,09
CIELO S/A CARTAO CREDITO 040365 116,42
REDECARD S.A CARTAO CREDITO 079047 156,19
VERO CARTAO DEBITO 114585 404,29
VERO CARTAO DEBITO 114586 199,87
CIELO S/A CARTAO DEBITO 101926 262,24
25 VERO BANRICOMPRAS A PRAZO 898216 619,60
VERO BANRICOMPRAS A VISTA 263855 333,14
VERO CARTAO CREDITO 656240 2.182,05
VERO CARTAO CREDITO 656241 1.153,70
CIELO S/A CARTAO CREDITO 641077 41,86
CIELO S/A CARTAO CREDITO 641078 93,03
REDECARD S.A CARTAO CREDITO 705335 156,27
VERO CARTAO DEBITO 761345 1.229,09
VERO CARTAO DEBITO 761346 307,53
CIELO S/A CARTAO DEBITO 737468 290,03
CIELO S/A CARTAO DEBITO 737469 412,93
RESGATE AUTOMATICO 000000 74.100,00
27 VERO BANRICOMPRAS A PRAZO 916537 254,76
VERO BANRICOMPRAS A VISTA 463886 910,60
VERO CARTAO CREDITO 027887 801,29
VERO CARTAO CREDITO 027888 479,59
VERO CARTAO CREDITO 027889 41,91
VERO CARTAO CREDITO 224868 267,26
VERO CARTAO CREDITO 224869 161,01
VERO CARTAO CREDITO 224870 144,73
CIELO S/A CARTAO CREDITO 019299 42,74
CIELO S/A CARTAO CREDITO 019300 72,49
CIELO S/A CARTAO CREDITO 217578 141,70
REDECARD S.A CARTAO CREDITO 055906 22,87
REDECARD S.A CARTAO CREDITO 244646 49,75
VERO CARTAO DEBITO 279344 458,92
VERO CARTAO DEBITO 279345 393,74
CIELO S/A CARTAO DEBITO 266081 380,41
CIELO S/A CARTAO DEBITO 266082 848,21
28 VERO BANRICOMPRAS A PRAZO 427354 332,90
VERO BANRICOMPRAS A VISTA 269379 232,29
VERO CARTAO CREDITO 314994 912,53
VERO CARTAO CREDITO 314995 536,39
CIELO S/A CARTAO CREDITO 305504 33,87
CIELO S/A CARTAO CREDITO 305505 56,26
REDECARD S.A CARTAO CREDITO 344054 89,10
VERO CARTAO DEBITO 381678 810,07
VERO CARTAO DEBITO 381679 463,54
CIELO S/A CARTAO DEBITO 367679 285,99
29 VERO BANRICOMPRAS A PRAZO 228273 139,72
VERO BANRICOMPRAS A VISTA 637529 499,77
VERO CARTAO CREDITO 678028 831,50
VERO CARTAO CREDITO 678029 318,86
CIELO S/A CARTAO CREDITO 668143 38,70
REDECARD S.A CARTAO CREDITO 708785 29,82
VERO CARTAO DEBITO 746619 1.159,92
CIELO S/A CARTAO DEBITO 732531 839,64
RESGATE AUTOMATICO 12.400,00
但实际上正确的输出将是:
RESGATE AUTOMATICO 112.400,00
它缺少第一个数字。
if not "%DataName:~2,1%" == " " goto CheckName
if "%DataName:~0,1%" == ";" goto CheckName
for /F "delims=01234567890" %%A in ("%DataName:~0,2%") do goto CheckName
set "DataName=%DataName:~3%"
000000
使脚本理解为删除第一个字符(12.400而不是112.400)。
最佳答案
这是增强的批处理脚本,解决了两个问题。
@echo off
setlocal EnableExtensions DisableDelayedExpansion
set "DataCount=0"
set "MaxNameLength=19"
set "TempFile1=%TEMP%\Output.tmp"
set "TempFile2=%TEMP%\Sorted.tmp"
set "OutputFile=Output.txt"
"%ProgramFiles(x86)%\CoolUtils\Total PDF Converter\PDFConverter.exe" "%UserProfile%\Desktop\teste.oxps" "%UserProfile%\Desktop\teste.txt"
del /F "%UserProfile%\Desktop\teste.pdf"
%SystemRoot%\System32\findstr.exe /V /R /C:"http" /C:"Banrisul" /C:"Sac" /C:":" /C:"-" /C:"SAC" /C:"OUVIDORIA" /C:"B A N R I S U L" /C:"+" "%UserProfile%\Desktop\teste.txt" >"%TempFile1%"
if not exist "%TempFile1%" goto EndBatch
rem Process each line in the output file line by line with leading
rem spaces and tabs already removed by FOR, but no other characters.
for /F usebackq^ tokens^=*^ eol^= %%I in ("%TempFile1%") do (
set "DataRow=%%~I"
call :ProcessLine
)
goto FormatOutput
:ProcessLine
rem Remove all double quotes within the data row.
set "DataRow=%DataRow:"=%"
rem Remove all exclamation marks within the data row.
set "DataRow=%DataRow:!=%"
rem Remove all horizontal tabs within the data row by spaces.
set "DataRow=%DataRow: = %"
rem Replace all $ by the string #DollarSign# within the data row.
set "DataRow=%DataRow:$=#DollarSign#%"
rem Replace two spaces in series by a dollar sign.
set "DataRow=%DataRow: =$%"
rem Replace all occurrences of dollar sign plus space by dollar sign.
set "DataRow=%DataRow:$ =$%"
rem Split up the data row using dollar sign as delimiter which can result
rem in four or just three tokenized substrings depending on existence of
rem 01, 02, ... in first data column. Of interest is the name string in
rem first or second data column and the value string in third or fourth
rem data column.
for /F tokens^=1-4^ delims^=$^ eol^= %%J in ("%DataRow%") do (
if "%%M" == "" (
set "DataName=%%~J"
set "DataValue=%%L"
) else (
set "DataName=%%~K"
set "DataValue=%%M"
)
)
rem It is safe now to replace the string #DollarSign# back to dollar sign.
set "DataName=%DataName:#DollarSign#=$%"
rem If the first 2 characters of data name are two digits and third
rem character is a space then remove those 3 characters from data name.
if not "%DataName:~2,1%" == " " goto CheckName
if "%DataName:~0,1%" == ";" goto CheckName
for /F "delims=01234567890" %%J in ("%DataName:~0,2%") do goto CheckName
set "DataName=%DataName:~3%"
rem Data names not containing one of the following four strings
rem should be at end of the list and not included in the total sum.
:CheckName
if not "%DataName:DEBITO=%" == "%DataName%" goto ReformatValue
if not "%DataName:CREDITO=%" == "%DataName%" goto ReformatValue
if not "%DataName:A VISTA=%" == "%DataName%" goto ReformatValue
if not "%DataName:A PRAZO=%" == "%DataName%" goto ReformatValue
set "DataName=z_%DataName%"
rem Floating point arithmetic is not supported by Windows command processor,
rem just signed 32-bit integer arithmetic with values in range -2147483648
rem to 2147483647. Therefore remove all dots and commas from data value.
:ReformatValue
set "DataValue=%DataValue:.=%"
set "DataValue=%DataValue:,=%"
for /F "tokens=* delims=0" %%J in ("%DataValue%") do set "DataValue=%%J"
if not defined DataValue set "DataValue=0"
rem Add the data value as integer to total sum. There is no special
rem overflow handling implemented yet in case of total sum exceeds
rem the maximum 32-bit positive signed integer value 2147483647.
if not "%DataName:~0,2%" == "z_" set /A "#TotalSum+=DataValue"
rem Find out if a data value of current data name is already in list
rem of environment variables and in this case just add the data value
rem to the existing sum for data data name and exit the subroutine.
for /F "tokens=1* delims==" %%J in ('set $\ 2^>nul') do if /I "%%K" == "%DataName%" set /A "#%%~nJ+=DataValue" & goto :EOF
rem This is a new data name with its first data value. So set
rem the appropriate environment variables for name and value.
set /A DataCount+=1
set "$\%DataCount%=%DataName%"
set "#%DataCount%=%DataValue%"
rem For a later aligned output find out the length of the data name and
rem remember its length if being greater than longest data name up to now.
rem z_ added at beginning of some data names must be always ignored for
rem length of data name.
set "NameLength=1"
:GetNameLength
set "DataName=%DataName:~1%"
if not "%DataName%" == "" set /A "NameLength+=1" & goto GetNameLength
if "%DataName:~0,2%" == "z_" set /A NameLength-=2
if %NameLength% GTR %MaxNameLength% set "MaxNameLength=%NameLength%"
rem Exit the subroutine.
goto :EOF
:FormatOutput
rem Add 3 to maximum name length to have always at least 3 spaces
rem between longest data name and the sum of the data values.
set /A MaxNameLength+=3
setlocal EnableDelayedExpansion
rem Build a string consisting of spaces according to maximum name length.
set "SpacesName="
for /L %%I in (1,1,%MaxNameLength%) do set "SpacesName=!SpacesName! "
rem Find out the maximum value which is usually the total sum, but
rem could be also a different value like sum of RESGATE AUTOMATICO.
set "MaximumValue=%#TotalSum%"
setlocal EnableDelayedExpansion
for /F "tokens=2 delims==" %%I in ('set #') do if %%I GTR !MaximumValue! set "MaximumValue=%%I"
endlocal & set "MaximumValue=%MaximumValue%"
rem Format value of maximum value.
call :FormatNumber %MaximumValue%
rem For a later aligned output find out the length of the maximum value.
set "ValueLength=1"
:GetValueLength
set "DataValue=%DataValue:~1%"
if not "%DataValue%" == "" set /A "ValueLength+=1" & goto GetValueLength
rem Build a string consisting of spaces according to maximum name length.
set "SpacesValue="
for /L %%I in (1,1,%ValueLength%) do set "SpacesValue=!SpacesValue! "
rem Output the data names with appropriate number of aligning spaces
rem and the data sum for each data name formatted and with aligning
rem spaces into the output file.
set /A ExtraNameLength=MaxNameLength+2
del "%TempFile1%" 2>nul
(for /F "tokens=1* delims==" %%I in ('set $\ 2^>nul') do (
set "DataName=%%J%SpacesName%"
if not "!DataName:~0,2!" == "z_" (
set "DataName=!DataName:~0,%MaxNameLength%!"
) else set "DataName=!DataName:~0,%ExtraNameLength%!"
call :FormatNumber !#%%~nI!
set "DataValue=%SpacesValue%!DataValue!"
set "DataValue=!DataValue:~-%ValueLength%!"
echo !DataName!!DataValue!
))>>"%TempFile1%"
rem Sort the lines in output file according to name.
%SystemRoot%\System32\sort.exe "%TempFile1%" /O "%TempFile2%"
del "%TempFile1%" 2>nul
rem 16 is the length of string CARDS OF MONTH with a space on both sides.
set /A LineLength=MaxNameLength+ValueLength
set /A HeadLength=(LineLength-16) / 2
rem Build the heading for the output file with centered CARDS OF MONTH
rem and create the output file with this heading as first line.
set "HyphensHead="
for /L %%I in (1,1,%HeadLength%) do set "HyphensHead=!HyphensHead!-"
set "Heading=%HyphensHead% CARDS OF MONTH %HyphensHead%"
set /A HeadLength=HeadLength*2 + 16
if not %HeadLength% == %LineLength% set "Heading=%Heading%-"
echo %Heading%>"%OutputFile%"
set "TotalSumWrite=1"
for /F usebackq^ tokens^=*^ eol^= %%I in ("%TempFile2%") do (
set "DataRow=%%I"
if defined TotalSumWrite (
if not "!DataRow:~0,2!" == "z_" (
echo !DataRow!>>"%OutputFile%"
) else (
rem Append the total summary to the output file.
set "TotalSumWrite="
>>"%OutputFile%" echo %SpacesName: =-%%SpacesValue: =-%
set "DataName=TOTAL OF ALL:%SpacesName%"
set "DataName=!DataName:~0,%MaxNameLength%!"
call :FormatNumber %#TotalSum%
set "DataValue=%SpacesValue%!DataValue!"
set "DataValue=!DataValue:~-%ValueLength%!"
>>"%OutputFile%" echo !DataName!!DataValue!
>>"%OutputFile%" echo %SpacesName: =-%%SpacesValue: =-%
>>"%OutputFile%" echo !DataRow:~2!
)
) else echo !DataRow:~2!>>"%OutputFile%"
)
if defined TotalSumWrite (
>>"%OutputFile%" echo %SpacesName: =-%%SpacesValue: =-%
set "DataName=TOTAL OF ALL:%SpacesName%"
set "DataName=!DataName:~0,%MaxNameLength%!"
call :FormatNumber %#TotalSum%
set "DataValue=%SpacesValue%!DataValue!"
set "DataValue=!DataValue:~-%ValueLength%!"
>>"%OutputFile%" echo !DataName!!DataValue!
)
del "%TempFile2%" 2>nul
endlocal
goto EndBatch
rem The subroutine below reformats 0 to 99 to 0,00 to 0,99 and inserts
rem dots on larger values after a series of 3 digits left to the comma.
:FormatNumber
set "DataValue=%1"
if "%DataValue:~1,1%" == "" set "DataValue=0%DataValue%"
if "%DataValue:~2,1%" == "" set "DataValue=0%DataValue%"
set "DataValue=%DataValue:~0,-2%,%DataValue:~-2%"
if not "%DataValue:~6,1%" == "" set "DataValue=%DataValue:~0,-6%.%DataValue:~-6%"
if not "%DataValue:~10,1%" == "" set "DataValue=%DataValue:~0,-10%.%DataValue:~-10%"
goto :EOF
:EndBatch
endlocal
0,08
到
0,99
范围内的值由于前导
0
而在删除逗号后被错误解释为无效或有效的八进制数字而不是十进制数字。
for /F "tokens=* delims=0" %%J in ("%DataValue%") do set "DataValue=%%J"
if not defined DataValue set "DataValue=0"
0,08
到
0,99
中的所有值(值中包含数字
8
或
9
)均被解释为无效的八进制数,导致在算术表达式中使用值
0
计算总和。
0
,如果在循环后由于值是
0,00
而不再定义该数据值,那么将使用值
DataValue
重新定义环境变量
0
。
RESGATE AUTOMATICO
的输出总和错误,原因是:
rem Format value of total sum.
call :FormatNumber %#TotalSum%
rem For a later aligned output find out the length of the total
rem sum which is expected to be the greatest value in output.
98.847,01
而
RESGATE AUTOMATICO
的总和为
112.400,00
,其中字符更多。
rem Find out the maximum value which is usually the total sum, but
rem could be also a different value like sum of RESGATE AUTOMATICO.
set "MaximumValue=%#TotalSum%"
setlocal EnableDelayedExpansion
for /F "tokens=2 delims==" %%I in ('set #') do if %%I GTR !MaximumValue! set "MaximumValue=%%I"
endlocal & set "MaximumValue=%MaximumValue%"
rem Format value of maximum value.
call :FormatNumber %MaximumValue%
rem For a later aligned output find out the length of the maximum value.
关于windows - 使用批处理脚本将相同名称的内容连接在一起,然后将每个内容的值求和,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62268664/
我的问题:非常具体。我正在尝试想出解析以下文本的最简单方法: ^^domain=domain_value^^version=version_value^^account_type=account_ty
好吧,这就是我的困境: 我正在为 Reddit 子版 block 开发常见问题解答机器人。我在 bool 逻辑方面遇到了麻烦,需要一双更有经验的眼睛(这是我在 Python 中的第一次冒险)。现在,该
它首先遍历所有 y 值,然后遍历所有 x 值。我需要 X 和 y 同时改变。 For x = 3 To lr + 1 For y = 2 To lr anyl.Cells(x, 1)
假设我有一个包含 2 列的 Excel 表格:单元格 A1 到 A10 中的日期和 B1 到 B10 中的值。 我想对五月日期的所有值求和。我有3种可能性: {=SUM((MONTH(A1:A10)=
如何转换 Z-score来自 Z-distribution (standard normal distribution, Gaussian distribution)到 p-value ?我还没有找到
我正在重写一些 Javascript 代码以在 Excel VBA 中工作。由于在这个网站上搜索,我已经设法翻译了几乎所有的 Javascript 代码!但是,有些代码我无法准确理解它在做什么。这是一
我遇到过包含日期格式的时间戳日期的情况。然后我想构建一个图表,显示“点击”项目的数量“每天”, //array declaration $array1 = array("Date" => 0); $a
我是scala的新手! 我的问题是,是否有包含成员的案例类 myItem:Option[String] 当我构造类时,我需要将字符串内容包装在: Option("some string") 要么 So
我正在用 PHP 创建一个登录系统。我需要用户使用他或她的用户名或电子邮件或电话号码登录然后使用密码。因为我知道在 Java 中我们会像 email==user^ username == user 这
我在 C++ 项目上使用 sqlite,但是当我在具有文本值的列上使用 WHERE 时出现问题 我创建了一个 sqlite 数据库: CREATE TABLE User( id INTEGER
当构造函数是显式时,它不用于隐式转换。在给定的代码片段中,构造函数被标记为 explicit。那为什么在 foo obj1(10.25); 情况下它可以工作,而在 foo obj2=10.25; 情况
我知道这是一个主观问题,所以如果需要关闭它,我深表歉意,但我觉得它经常出现,让我想知道是否普遍偏爱一种形式而不是另一种形式。 显然,最好的答案是“重构代码,这样你就不需要测试是否存在错误”,但有时没有
这两个 jQuery 选择器有什么区别? 以下是来自 w3schools.com 的定义: [attribute~=value] 选择器选择带有特定属性,其值包含特定字符串。 [attribute*=
为什么我们需要CSS [attribute|=value] Selector根本当 CSS3 [attribute*=value] Selector基本上完成相同的事情,浏览器兼容性几乎相似?是否存在
我正在解决 regx 问题。我已经有一个像这样的 regx [0-9]*([.][0-9]{2})。这是 amont 格式验证。现在,通过此验证,我想包括不应提供 0 金额。比如 10 是有效的,但
我正在研究计算机科学 A 考试的样题,但无法弄清楚为什么以下问题的正确答案是正确的。 考虑以下方法。 public static void mystery(List nums) { for (
好的,我正在编写一个 Perl 程序,它有一个我收集的值的哈希值(完全在一个完全独立的程序中)并提供给这个 Perl 脚本。这个散列是 (string,string) 的散列。 我想通过 3 种方式对
我有一个表数据如下,来自不同的表。仅当第三列具有值“债务”并且第一列(日期)具有最大值时,我才想从第四列中获取最大值。最终值基于 MAX(DATE) 而不是 MAX(PRICE)。所以用简单的语言来说
我有一个奇怪的情况,只有错误状态保存到数据库中。当“状态”应该为 true 时,我的查询仍然执行 false。 我有具有此功能的 Controller public function change_a
我有一个交易表(针对所需列进行了简化): id client_id value 1 1 200 2 2 150 3 1
我是一名优秀的程序员,十分优秀!