我遇到一个赋值问题,想把下面的第八列数据都除以100,就是amout1对应的数据。
数据文件(temp2.csv)如下:
yearmonth,com_code,com_name,partner_code,partner_name,province_code,province_name,amount1,unit1,dollar,custom_value,charges
202301,6111201000,,313,Albania,39,"Cleveland, OH",1,dozens,277,273,4
202301,6111202000,,402,Argentina,12,"Miami, FL",144,dozens,19831,19787,44
202301,6111205000,,402,Argentina,12,"Miami, FL",229,dozens,34038,33963,75
202301,6111206010,,402,Argentina,12,"Miami, FL",75,dozens,10476,10453,23
202301,6111206070,,402,Argentina,12,"Miami, FL",42,dozens,4443,4433,10
202301,6110909014,,103,Bangladesh,24,"Baltimore, MD",128,dozens,19260,18341,919
202301,6110909090,,103,Bangladesh,39,"Cleveland, OH",167,dozens,25295,24975,320
202301,6110909090,,103,Bangladesh,36,"New York, NY",3383,dozens,355741,334614,21127
程序如下:- if exist chk.csv del chk.csv
- setlcal enabledelayedexpansion
- for /f "skip=1 delims=, tokens=1-12" %%a in (temp2.csv) do (
- echo %%h
- set /a value=%%h/100
- echo !value! >>chk.csv
- )
复制代码 set /a value=%%h/100,仅仅取值整数,而小数点后数值不能保留,这个怎么能够保留小数呢? |