解析脚本文件C++

来源:互联网 发布:金和网络股票停牌 编辑:程序博客网 时间:2024/06/05 18:37

#include <fstream.h>
#include <string.h>
void main()

 ifstream file("scr_catsacfmk.scr");  
 if(!file.good()) {
  cout<<"Error has happend on opening the file"; 
 }
 char output[32]="";
 while (!file.eof() ){
  file>>output; 
  if(strncmp(output,"SKELMAKE",8) == 0){
   for(int i=0;i<9;i++){
    file>>output;
/////////////////////////////////////////////
    cout<<output<<' ';
   }

   cout<<'/n';
  }
  else if(strncmp(output,"ITNOSET",7) == 0){
   //0
   
  }
  else if(strncmp(output,"ECRSNAMERESET",13) == 0){
   //0
  }
  else if(strncmp(output,"SPLBLKFILEOUT",13) == 0){
   //1 para
   file>>output;
   cout<<output<<'/n';
  }
  else if(strncmp(output,"SPLTMPDELETE",12) == 0){
   //1
   file>>output;
   cout<<output<<'/n';
  }
  else if(strncmp(output,"CSNAMESET",9) == 0){
   //1 para
   file>>output;
   cout<<output<<'/n';
  }  
 }
 file.close(); 
}

原创粉丝点击