尝试根据您的情况调整此示例:
Imports System.Text
Imports System.IO
Module Module1
Sub Main()
Read input
Dim inputBuffer As Byte() = File.ReadAllBytes(".input.txt")
Manipulate the input
Dim outputBuffer As Byte() = DoSomethingWithMyBuffer(inputBuffer)
Add headers
There are several ecodings to choose from, make sure you are using
the appropriate encoder for your file.
Dim outputTextFromBuffer As String = Encoding.UTF8.GetString(outputBuffer)
Dim finalOutputBuilder As StringBuilder = New StringBuilder()
finalOutputBuilder.AppendLine("""ID"",""Name"",""Class""")
finalOutputBuilder.Append(outputTextFromBuffer)
Write output
File.WriteAllText(".output.txt", finalOutputBuilder.ToString(), Encoding.UTF8)
End Sub
Private Function DoSomethingWithMyBuffer(inputBuffer As Byte()) As Byte()
Do nothing because this is just an example
Return inputBuffer
End Function
End Module