?
std::string BLine(std::string zeile)
{
string::size_type a= zeile.length()+1 , b;
std::string line = "";
while(b!=string::npos && b != 0)
{
b=zeile.rfind("," ,a);
line+=("#"+zeile.substr(b+1, a-b)).c_str();
a=b;
a--;
}
if(line.length() != 0)
return line;
return zeile;
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
string zeile="";
ifstream myfile ("c:\\temp\\example.txt");
if (myfile.is_open())
{
while ( myfile.good())
{
getline (myfile, zeile);
Edit1->Text = NLine(zeile).c_str();
Application->ProcessMessages();
Sleep(2000);
}
myfile.close();
}
else
Edit1->Text= "Unable to open file";
}