C++Builder相談室 Par ..
183:デフォルトの名無しさん
08/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());
}
}
}
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
5031日前に更新/113 KB
担当:undef