程序代码:
CLOSE DATABASES USE 考生成绩 IN 0 ZAP CREATE CURSOR tt (cName C(254)) APPEND FROM 考试成绩.TXT SDF SELECT cName FROM tt WHERE NOT EMPTY(cName) INTO CURSOR tt SELECT cName FROM tt WHERE INLIST(RECNO()%12, 3, 5, 6, 7, 8, 9) INTO CURSOR tt FOR i =1 TO _Tally/6 COPY TO ARRAY a_6 FOR BETWEEN(RECNO(), (i - 1)*6 + 1, i*6) nRows = OCCURS("准考证号:",a_6[1]) LOCAL aCj[nRows, 8] FOR ii = 1 TO 6 DO CASE CASE "准考证号:"$a_6[ii] nRows = ALINES(aName, a_6[ii], 1+4, "准考证号:", "姓名:") FOR iii = 1 TO nRows nRow = CEILING(iii/2) IF iii%2 = 1 aCj[nRow, 1] = aName[iii] ELSE aCj[nRow, 2] = aName[iii] ENDIF ENDFOR CASE "语 文"$a_6[ii] nRows = ALINES(aName, a_6[ii], 1+4, "语 文") FOR iii = 1 TO nRows aCj[iii, 3] = VAL(aName[iii]) ENDFOR CASE "数 学"$a_6[ii] nRows = ALINES(aName, a_6[ii], 1+4, "数 学") FOR iii = 1 TO nRows aCj[iii, 4] = VAL(aName[iii]) ENDFOR CASE "外 语"$a_6[ii] nRows = ALINES(aName, a_6[ii], 1+4, "外 语") FOR iii = 1 TO nRows aCj[iii, 5] = VAL(aName[iii]) ENDFOR CASE "综合"$a_6[ii] nRows = ALINES(aName, a_6[ii], 1+4, "综合") FOR iii = 2 TO nRows aCj[iii-1, 6] = VAL(aName[iii]) ENDFOR CASE "量化成绩"$a_6[ii] nRows = ALINES(aName, a_6[ii], 1+4, "量化成绩", "总成绩") FOR iii = 1 TO nRows nRow = CEILING(iii/2) IF iii%2 = 1 aCj[nRow, 7] = VAL(aName[iii]) ELSE aCj[nRow, 8] = aName[iii] ENDIF ENDFOR ENDCASE ENDFOR INSERT INTO 考生成绩 FROM ARRAY aCj ENDFOR SELECT 考生成绩 BROWSE