shchaoge 当前离线
上等兵
pd1 当前离线
五级士官
powershell -c "gc .\1.txt|%{[system.String]::Join('|',[int[]]$_.split('|'))}>2.txt"复制代码
TOP
hfxiang 当前离线
上尉
gawk -F"|" -v"OFS=|" "{$NF=int($NF+0.5)}1" 1.txt>2.txt复制代码
ShowCode 当前离线
VIP1
@echo off set "OldFile=1.txt" set "NewFile=2.txt" cd /d "%~dp0" setlocal enabledelayedexpansion (for /f "tokens=1-5 delims=|." %%a in ('type "%OldFile%"') do ( if "1%%e" geq "15" ( set /a n=%%d+1 ) else ( set n=%%d ) echo %%a^|%%b^|%%c^|!n! ))>"%NewFile%"复制代码
WHY 当前离线
上校
gawk -F"|" -v OFS="|" "{for(i=1;i<=NF;i++)$i=sprintf(\"%%.0f\", $i)}1" a.txt > b.txt复制代码
@if(0)==(0) echo off type a.txt | cscript //nologo //e:jscript "%~f0" pause & exit @end var s = WSH.StdIn.ReadAll().replace(/\d+\.\d+/g,function(s0){return Math.round(1*s0)}); WSH.Echo(s);复制代码
PowerShell "$s = (gc a.txt -ReadCount 0) -join \"`r`n\"; $s = [regex]::Replace($s, '(?>[0-9]+)\.[0-9]+',{[Math]::Round($args[0].Value)}); sc b.txt -Value $s"复制代码
wanghan519 当前在线
二级士官