C thì tui ko rành, nếu cậu học lai cả C++ thì đây là ví dụ :
File content :
Code:
not abcdef abcdef
bcadef bcadef
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
int main(){
std::ifstream ifs("data.txt");
std::string line_of_text;
std::string output_word;
while(std::getline(ifs, line_of_text))
{
std::istringstream iss(line_of_text);
std::string first_line;
iss >> first_line;
//skip first line;
if(first_line == "not")
continue;
std::getline(iss, output_word);
std
::cout << output_word
<< '\n'; }
return 0;
}