title: How to create a csv file from string variable using streamwriter in Vb.Net?
body: <p>I am working on VS 2012, Vb.Net using .Net 4.0.</p>
  
  <p>Using Streamwriter or FileStream, I am trying to create a Temp csv which will be located in c:\windows\temp folder. Values for the .csv file will be populated from a string variable.</p>
  
  <p>Sample values in the string variable will look like as..</p>
  
  <pre><code>1,2,3,411,345
  2,3,4,55,678
  5,6,7,8,9999
  </code></pre>
  
  <p>How to write a .csv file from string variable ?</p>
  
  <pre><code>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
  </code></pre>