c++ MFC保存和解析csv文件数据

保存数据

//设置保存的csv文件名  这里以savemycsv为例
        CStdioFile write_data_file;
        int cycle_num = 3;
        CString show = "";
        CString temp_str = "";
        CFileDialog fpdlg(FALSE, "csv", "savemycsv", OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, "(?????à??)(*.csv)|*.csv||", NULL);
		if (fpdlg.DoModal() == IDOK) {
			write_data_path = fpdlg.GetPathName();
			write_data_path = write_data_path + ".csv";
		}

		if (write_data_path == L"") {
			AfxMessageBox("Please choose file!");
			m_vcmtest_savedata.SetCheck(0);
		}
		else {
			if (!write_data_file.Open(write_data_path, CFile::modeWrite | CFile::modeCreate)) {
				write_data_file.Close();
			}
			else {
                //写入csv的标题栏 这里就以test为例 如果写入多列请在test后面添加并以“,”结尾
                for (int i = 0; i < cycle_num ; i++) {
					if (i == cycle_num - 1) {
						temp_st

你可能感兴趣的:(C++,MFC,c++,mfc,开发语言)