★如何将座次表旋转180度?
如题,有附件中“原始座次表.TXT”,现在希望用vfp编程将其旋转180度,使之成为“目标座次表.TXT”中的格式。请问如何实现?
座次表调整.rar
(1.49 KB)
[此贴子已经被作者于2016-1-26 10:02编辑过]
CLOSE DATABASES CREATE TABLE 表2(A0 C(10),A1 C(7),A2 C(7),A3 C(7),A4 C(7),A5 C(7),A6 C(7),A7 C(7),A8 C(7),A9 C(7),A10 C(7)) APPEND FROM 原始座次表.TXT DELIMITED WITH TAB FOR NOT EMPTY(a0) SELECT a0,a10 as a1,a9 as a2,a8 as a3,a7 as a4,a6 as a5,a5 as a6,a4 as a7,a3 as a8,a2 as a9,a1 as a10 FROM 表2 ORDER BY a0 DESC INTO TABLE 表3 SELECT 表3 DO whil NOT EOF() ma1=a1 ma2=a2 ma3=a3 ma4=a4 ma5=a5 ma6=a6 ma7=a7 ma8=a8 ma9=a9 ma10=a10 IF ALLTRIM(a0)='【第8排】' REPLACE a1 WITH ma3,a2 WITH ma4,a3 WITH ma5,a4 WITH ma6,a5 WITH ma7,a6 WITH ma8,a7 WITH ma9,a8 WITH ma10,a9 WITH ma1,a10 WITH ma2 ENDIF IF EOF() EXIT ENDIF SKIP ENDDO COPY TO 目标座次表.TXT SDF