title: VBA - Split CSV file in multidimensional array
body: <p>I have a .csv which is in the following format:</p>
  
  <p>[TestHeader]FIELDS,"LANGUAGE","LC_NUMERIC","CELLNAME","TESTTYPE","REPORTER","TITLE","STARTDATE","STARTTIME","ENDDATE","ENDTIME"DATATYPE,"Text(80)","Text(80)","Text(64)","Text(80)","Text(80)","Text(80)","Text(12)","Text(20)","Text(12)","Text(20)"</p>
  
  <p>I would like to put this data in a multidimensional array that would mimic as if it was in a sheet. Where the cells are empty it would be empty in the array as well.
  <a href="https://i.stack.imgur.com/9TxH8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9TxH8.png" alt="enter image description here"></a></p>
  
  <p>I am trying to use the following but it only puts the data in a 1D array which is not suitable for what I need.</p>
  
  <pre><code>Dim Delimiter As String
  Dim TextFile As Integer
  Dim FilePath As String
  Dim FileContent As String
  Dim LineArray() As String
  Dim DataArray() As String
  
  'Inputs
    Delimiter = ","
    FilePath = emiFilePath
  
  'Open the text file in a Read State
    TextFile = FreeFile
    Open FilePath For Input As TextFile
  
  'Store file content inside a variable
    FileContent = Input(LOF(TextFile), TextFile)
  
  'Close Text File
    Close TextFile
  
  'Separate Out lines of data
    LineArray() = Split(FileContent, Delimiter, -1, vbTextCompare)
  
  'Read Data into an Array Variable
        'Re-Adjust Array boundaries
          ReDim Preserve DataArray(UBound(LineArray))
  '
        'Load line of data into Array variable
          For y = LBound(LineArray) To UBound(LineArray)
            DataArray(y) = Replace(LineArray(y), Chr(34), vbNullString)
          Next y
  </code></pre>