به جای کد بالا از c++ برای انجام اینکار استفاده کنید.
#include <stdafx.h>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
using namespace std;
int main()
{
const std::string file_name = R"(d:\test.txt)";
std::ifstream file(file_name.c_str());
if (!file.is_open())
return -1;
std::string line;
std::vector<float> values;
while (std::getline(file,line))
{
auto index = line.find("=");
if (index != -1) {
std::string numb_str = std::string(line.begin() + index + 1, line.end());
auto value = std::stof(numb_str);
values.push_back(value);
}
}
file.close();
for (auto value : values)
cout << value << endl;
return 0;
}