我在一些编码上苦苦挣扎,希望有人能帮助我,我想做的是读取一个文本文件并将 column2 转换为小写并再次保存。
但我得到“整数”类型的值无法转换为“System.Globalization.CultureInfo”。.ToLower 之后?
Dim Convertcolumn = From line In System.IO.File.ReadLines("Path")
Select line.Split(" "c)(1) & line.ToLower(1)
Dim writer As IO.StreamWriter = New IO.StreamWriter("Path2")
For Each line In Convertcolumn
writer.Write((line) & Environment.NewLine)
Next
更新编码:
Dim Convertcolumn = From line In System.IO.File.ReadLines("C:\Test1.txt")
Select line.Split(" "c)(1) & line.Split(" "c)(1).ToLower()
Dim writer As IO.StreamWriter = New IO.StreamWriter("C:\Test2.txt")
For Each line In Convertcolumn
writer.Write((line) & Environment.NewLine)
Next
抱歉,当我添加评论时,它没有显示为列,数据看起来像这样
D00001 BLACK user
D00002 BLACK user
我想把它改成
D00001 black user
D00002 black user