I am working on VS 2012, Vb.Net using .Net 4.0.
Using Streamwriter or FileStream, I am trying to create a Temp csv that will be in the c: \ windows \ temp folder. Values โโfor the CSV file will be populated from the string variable.
Examples of values โโin a string variable will look like this:
1,2,3,411,345 2,3,4,55,678 5,6,7,8,9999
How to write a CSV file from a string variable?
Dim reader As StreamReader = New System.IO.StreamReader(File.OpenRead("D:\CSV\Test.csv")) Dim listA As New List(Of String)() Dim listB As New List(Of String)() Dim s As String = "" While Not reader.EndOfStream Dim line As String = reader.ReadLine() Dim values As String() = line.Split(";"c) listA.Add(values(0)) s = s + line + Chr(10) End While
source share