0
我將如何檢查下面的字符串在txt中逐行檢查並替換每一個?逐行替換一個字符串中的字符串
"FLD_CUSTORDREF_FLD"
"FLD_CUSTOMERNAME_FLD"
"FLD_ADDRESSLINE1_FLD"
"FLD_ADDRESSLINE2_FLD"
"FLD_CITY_FLD"
例如,
If file line has "FLD_CITY_FLD"
change to Header->City
else if file line has "FLD_CUSTOMERNAME_FLD"
change to Header->Name
我可以閱讀使用
while (fgets (line, sizeof line, file) != NULL)
每一行,但如何將我檢查匹配的字符串?
它必須與C?使用Perl,Awk,Ruby,Python等會簡單得多。 –
阿門對此 - 這必須是作業或不適當選擇工具的光輝榜樣 –