可能最简单的方法是编写一个小程序来做到这一点。这可以用许多不同语言中的任何一种来完成,但是由于您提到 Excel,这里有一个快速而肮脏的基于 VBA 的选项,它可能足以完成一次性任务。这不会那么快,在我的硬件上花了大约一分钟。其他选择无疑会更快......
这只有效,因为数据从未真正触及工作表,因此百万行限制不会发挥作用。
Sub RoundCsv()
Dim fso As FileSystemObject
Dim csvIn As TextStream
Dim csvOut As TextStream
Dim FinePathAndName As String
Dim FinePathAndNameNew As String
Dim ln As String
Dim dat As Variant
Dim RoundColumn As Long
Set fso = New FileSystemObject
FinePathAndName = "C:\Your\Path\And\File\Name.csv"
FinePathAndNameNew = "C:\Your\Path\And\File\NameNew.csv"
RoundColumn = 3 '<-- set to the column number to round, count from 0
Set csvIn = fso.OpenTextFile(FinePathAndName, ForReading, False)
Set csvOut = fso.CreateTextFile(FinePathAndNameNew, True)
Do While Not csvIn.AtEndOfStream
ln = csvIn.ReadLine
dat = Split(ln, ",")
dat(RoundColumn) = Round(dat(RoundColumn))
ln = Join(dat, ",")
csvOut.WriteLine ln
Loop
csvIn.Close
csvOut.Close
Set csvIn = Nothing
Set csvOut = Nothing
Set fso = Nothing
End Sub