读取文件问题
各位高手,我想将图片上的数据输出,但是读取时数据的列数不同,请问如何设置一个条件语句进行控制?敬请赐教,谢谢!图片看不清楚,呵呵,换个格式
435, BEAM, 9, 6, 250, 251, 0
436, BEAM, 9, 6, 251,8234, 0
437, BEAM, 9, 5, 252, 253, 0
438, BEAM, 9, 5, 253,8215, 0
439, BEAM, 9, 4, 254, 255, 0
440, BEAM, 9, 4, 255,8189, 0
441, BEAM, 9, 3, 256, 257, 0
442, BEAM, 9, 3, 257,8216, 0
443, BEAM, 9, 2, 258, 259, 0
444, BEAM, 9, 2, 259, 260, 0
445, BEAM, 9, 1, 260, 1, 0
546, PLATE , 3, 1, 68, 867, 871, 870, 1
547, PLATE , 3, 1, 69, 883, 886, 874, 1
548, PLATE , 3, 1, 70, 897, 900, 889, 1
549, PLATE , 3, 1, 71, 911, 914, 903, 1
550, PLATE , 3, 1, 72, 925, 928, 917, 1
551, PLATE , 3, 1, 73, 939, 942, 931, 1
552, PLATE , 3, 1, 74, 953, 956, 945, 1
553, PLATE , 3, 1, 75, 967, 970, 959, 1
554, PLATE , 3, 1, 76, 981, 984, 973, 1
555, PLATE , 3, 1, 77, 995, 998, 987, 1
556, PLATE , 3, 1, 78,1009,1012,1001, 1
557, PLATE , 3, 1, 79,1023,1026,1015, 1 backspace1 ,问题已经解决了,呵呵!:) 遇到新问题: 用fortran中的那一个命令可以读取换行的语句,如下所示:
3, USER , 异性板 , 0, 0, , C, NO, 3, \
3.4700e+008, 2.0600e+008, 2.0600e+008, \
1.2000e-005, 1.2000e-005, 1.2000e-005, \
1.7920e+008, 7.9200e+007, 7.9200e+007, \
0.3, 0.3, 0.3, 76.98, 0
小弟刚学fortran,很多浅显的东西都不知道,敬请请各位指教!!!
页:
[1]