Validate a csv file

前端 未结 6 498
暖寄归人
暖寄归人 2021-01-20 02:34

This is my sample file

#%cty_id1,#%ccy_id2,#%cty_src,#%cty_cd3,#%cty_nm4,#%cty_reg5,#%cty_natnl6,#%cty_bus7,#%cty_data8
690,ALL2,,AL,ALBALODMNIA,,,,
90,ALL2,,         


        
6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-20 02:43

    If that's the only problem (and if you never have a comma in the field bt_cty_ccy_id), then you could remove such an extra comma by loading your file into an editor that supports regexes and have it replace

    ^([^,]*,[^,]*,[^,]*,),(?="[A-Z]{2}")
    

    with \1.

提交回复
热议问题