- 183 名前:デフォルトの名無しさん mailto:sage [2008/11/03(月) 23:14:27 ]
- しばらく待ってみましたが返事がないのでDelimiterを使わないバージョンを
書いてみました。 コンマの数や桁数などは決め打ちになってますので必要ならば適宜変更して ください。 void __fastcall TForm1::Button2Click(TObject *Sender) { OpenDialog1->Execute(); std::ifstream ifs(OpenDialog1->FileName.c_str()); std::string str; if (ifs) while (std::getline(ifs, str)) { std::string::size_type pos = str.find(',') + 1; if (str.substr(pos, 3) != "000") { pos = str.find(',', pos) + 1; Memo1->Lines->Add(str.substr(pos, 4).c_str()); } } }
|

|