登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
dat格式文件内容如下:(这是最佳路径的文件内容,数据之间用,隔开的,自己编的FORTRAN程序想把dat文件里的数据存放到txt的文件里面并以空格为间隔,希望能给予帮助)
WP, 14, 2005082818, , BEST, 0, 151N, 1548E, 15, 1006, DB, 0, , 0, 0, 0, 0,
WP, 14, 2005082900, , BEST, 0, 150N, 1540E, 25, 1002, DB, 0, , 0, 0, 0, 0, 1006, 160, 50, 0, 0, W, 0, , 0, 0, INVEST, S,
WP, 14, 2005082906, , BEST, 0, 151N, 1532E, 25, 1002, TD, 0, , 0, 0, 0, 0, 1006, 160, 50, 0, 0, W, 0, , 0, 0, INVEST, S,
WP, 14, 2005082912, , BEST, 0, 151N, 1523E, 30, 1000, TD, 0, , 0, 0, 0, 0, 1005, 180, 45, 0, 0, W, 0, , 0, 0, NONAME, S,
WP, 14, 2005082918, , BEST, 0, 151N, 1512E, 35, 997, TS, 34, NEQ, 30, 40, 40, 30, 1004, 190, 20, 0, 0, W, 0, , 0, 0, NABI, M,
WP, 14, 2005083000, , BEST, 0, 150N, 1501E, 45, 991, TS, 34, NEQ, 80, 60, 50, 70, 1002, 190, 25, 0, 0, W, 0, , 0, 0, NABI, M,
WP, 14, 2005083006, , BEST, 0, 149N, 1490E, 55, 984, TS, 34, NEQ, 70, 70, 70, 70, 1002, 190, 15, 0, 0, W, 0, , 0, 0, NABI, M,
WP, 14, 2005083006, , BEST, 0, 149N, 1490E, 55, 984, TS, 50, NEQ, 20, 20, 20, 20, 1002, 190, 15, 0, 0, W, 0, , 0, 0, NABI, M,
WP, 14, 2005083012, , BEST, 0, 150N, 1480E, 65, 976, TY, 34, NEQ, 100, 85, 70, 75, 1000, 200, 10, 0, 0, W, 0, , 0, 0, NABI, M,
WP, 14, 2005083012, , BEST, 0, 150N, 1480E, 65, 976, TY, 50, NEQ, 20, 20, 20, 20, 1000, 200, 10, 0, 0, W, 0, , 0, 0, NABI, M,
程序如下:
IMPLICIT NONE
INTEGER, PARAMETER :: M = 29, N = 60
INTEGER I, J
CHARACTER, DIMENSION(M,N) :: G
OPEN (10, FILE = "E:\new\bwp102012.dat", ACCESS = "DIRECT", FORM = "BINARY", RECL = M * N * 4)
READ (10, REC = 1) ((G(I, J), J = 1, N), I = 1, M)
WRITE (*, *) G(1,2)
OPEN (11, FILE = "E:\new\SHUJU.txt")
WRITE (11, 100) ((G(I, J), J = 1, N), I = 1, M)
100 FORMAT (29A)
END
|