看板 EzHotKey 關於我們 聯絡資訊
我也提供非巨集的寫法...,不知道有沒有違反板規... 剛才無聊寫的,c語言寫的 #include <stdio.h> int main() { char row[500]; char word[]="總經理"; char word2[]="法人"; FILE* cfPtr; FILE* cf2Ptr; cf2Ptr=fopen("result.txt","w"); if ((cfPtr=fopen("test.txt","r"))==NULL) printf("File could not be opened"); else{ while(!feof(cfPtr)){ if(fgets(row,500,cfPtr)!=NULL) if(strstr(row,word)!=NULL && strstr(row,word2)==NULL) fputs(row,cf2Ptr); } fcloseall(); } return 0; } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.118.207.32
VElysian:這樣不會違反板規的~~ ^__^ 02/08 17:58
wowcollage:謝謝大大,資料大概弄的差不多了,編輯器果然好用 02/09 19:41