There is a task to read data from the .csv file, separated by a semicolon ';', into the array String ^.
The number of rows and columns is known; I create an array dynamically. There are as many rows and columns in the array as in the file. That is, should fit perfectly.
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { setlocale(LC_ALL,"Russian"); array<String^,2>^ basedfs; array<String^,2>^ basehw; basedfs=gcnew array<String^,2>(stringsdfs,lenghtdfs);//первый массив, размерность определена в этих переменных. basehw=gcnew array<String^,2>(stringshw,lenghthw);//второй try { StreamReader^ dfs=gcnew StreamReader("MSV-BD1.csv");//файл,из которого читаю данные for (int i=0;i<stringsdfs;i++){ for(int j=0;j<lenghtdfs;j++){ basedfs[i,j]=Convert::ToString(dfs->ReadLine()->Split(';'));//пытаюсь засплитить через точку с запятой } } delete dfs; } catch (...) { textBox1->Text="Файл не может быть открыт"; } textBox2->Text=basedfs[3,7];//но здесь выводит System.String[]. }
How to read the data?
,” should be understood as “.". - VladD