我试图从.csv文件中读取内容并将其存储在变量中.后来我将这些内容写入新文件.代码正在成功执行,但数据未出现在新文件中.有什么建议吗? 这是我的代码: Dim ioFile As New System.IO.Stre
这是我的代码:
Dim ioFile As New System.IO.StreamReader("C:\sample.csv") Dim ioLine As String Dim ioLines As String ioLine = ioFile.ReadLine ioLines = ioLine While Not ioLine = "" ioLine = ioFile.ReadLine ioLines = ioLines & vbCrLf & ioLine End While Dim ioWriter As New System.IO.StreamWriter("C:\new.csv") ioWriter.WriteLine(ioLines) ioFile.Close() ioWriter.Close()MSDN网站上有一些非常简短且非常好的教程:
> How to: Write text to a file
> How to: Read text from a file