CLOSE DATABASES USE tk ZAP cStr = FILETOSTR("1.txt") FOR i = 1 TO OCCURS( "【", cStr) c1 = STREXTRACT(cStr, "【", "】", i) nTh = VAL(CHRTRAN(GETWORDNUM(c1, 1, "-"), "第题", "")) cTx = GETWORDNUM(c1, 2, "-") cTm = STREXTRACT(cStr, "】", "知识要点", i) cYd = STREXTRACT(cStr, "知识要点:", "答案:", i) cDa = STREXTRACT(cStr, "答案:", CHR(13) + CHR(10), i) INSERT INTO tk VALUES (nTh, cTx, cTm, cYd, cDa) ENDFOR SELECT tk BROWSE
CLOSE DATABASES USE tk ZAP cStr = FILETOSTR("1.txt") FOR i = 1 TO OCCURS( "【", cStr) c1 = STREXTRACT(cStr, "【", "】", i) nTh = VAL(CHRTRAN(GETWORDNUM(c1, 1, "-"), "第题", "")) cTx = GETWORDNUM(c1, 2, "-") cTm = STREXTRACT(cStr, "】", "知识要点", i) cYd = STREXTRACT(cStr, "知识要点:", "答案:", i) cDa = STREXTRACT(cStr, "答案:", CHR(13) + CHR(10), i) IF "——" $ cYd cCc = STREXTRACT(cYd, "——", CHR(13) + CHR(10)) ELSE cCc = "" ENDIF INSERT INTO tk VALUES (nTh, cTx, cTm, cYd, cDa, cCc) ENDFOR SELECT tk BROWSE
[此贴子已经被作者于2020-4-27 12:27编辑过]