1. 打开test_ids.txt 将里面的东西添加"1_",然后另存为test_ids_repaired.txt
1 #include <iostream> 2 #include <string> 3 #include <fstream> 4 #include <sstream> 5 #include <iostream> 6 using namespace std; 7 int main(){ 8 9 ifstream file; 10 file.open("/home/wangxiao/Downloads/Link to ASPL---code/features/test_ids.txt"); 11 ofstream in("/home/wangxiao/Downloads/test_ids_repaired.txt"); 12 13 std::string line; 14 std::string image_id; 15 16 while(getline(file, line)){ 17 std::string add = "1_"; 18 line = add + line; 19 20 image_id = line; 21 in<<image_id<<endl; 22 } 23 }
时间: 2024-10-12 20:45:31