主题:fortran90如何将两个文档中的数据合并成一个文档输出
例如 [color=FF0000]“rsm-1.txt”中数据如下:[/color]
1.0000 932.7000 219.2000 .1120 .0054 .5100 472.6800
2.0000 945.1000 282.7000 .3680 .0123 .5900 1004.5300
3.0000 982.3000 342.7000 .2970 .0169 .6400 1575.2600
4.0000 882.6000 236.1000 .0810 .0087 1.4300 3845.1300
5.0000 918.8000 317.1000 .1460 .0088 .8300 4219.6500
6.0000 875.1000 744.0000 .2300 .0111 1.1300 4458.9800
7.0000 1015.9000 539.7000 .1600 .0148 1.0500 4604.1200
8.0000 921.6000 373.4000 .2030 .0051 1.7000 4777.0200
9.0000 852.2000 690.9000 .0640 .0120 1.2000 5590.5500
10.0000 935.0000 700.0000 .2350 .0095 1.2000 6305.4100
11.0000 842.5000 640.7000 .1790 .0160 .8700 6334.6800
12.0000 1003.5000 653.5000 .0980 .0142 1.3100 6476.4600
[color=FF0000][color=C0C0C0]“rsm-2.txt”数据如下:[/color][/color]
13.0000 1502.9142 665.8377 .2984 .0114 .4418
14.0000 834.5303 451.6431 .1350 .0123 1.7683
15.0000 2162.6292 507.3860 .2752 .0073 1.4777
16.0000 752.7414 377.8538 .1560 .0064 .6650
17.0000 2251.9001 187.7713 .3240 .0066 .8568
18.0000 883.5994 208.1624 .2954 .0044 .6488
19.0000 786.1833 735.5757 .2028 .0176 1.3881
20.0000 2022.7322 520.5920 .2423 .0047 1.5216
21.0000 2405.3198 628.1454 .3437 .0066 .6965
如果我想把这个两个txt文档中的数据提取出来,合并成一个文档rsm.txt输出,其格式如下:
1.0000 932.7000 219.2000 .1120 .0054 .5100 472.6800
2.0000 945.1000 282.7000 .3680 .0123 .5900 1004.5300
3.0000 982.3000 342.7000 .2970 .0169 .6400 1575.2600
4.0000 882.6000 236.1000 .0810 .0087 1.4300 3845.1300
5.0000 918.8000 317.1000 .1460 .0088 .8300 4219.6500
6.0000 875.1000 744.0000 .2300 .0111 1.1300 4458.9800
7.0000 1015.9000 539.7000 .1600 .0148 1.0500 4604.1200
8.0000 921.6000 373.4000 .2030 .0051 1.7000 4777.0200
9.0000 852.2000 690.9000 .0640 .0120 1.2000 5590.5500
10.0000 935.0000 700.0000 .2350 .0095 1.2000 6305.4100
11.0000 842.5000 640.7000 .1790 .0160 .8700 6334.6800
12.0000 1003.5000 653.5000 .0980 .0142 1.3100 6476.4600
13.0000 1502.9142 665.8377 .2984 .0114 .4418
14.0000 834.5303 451.6431 .1350 .0123 1.7683
15.0000 2162.6292 507.3860 .2752 .0073 1.4777
16.0000 752.7414 377.8538 .1560 .0064 .6650
17.0000 2251.9001 187.7713 .3240 .0066 .8568
18.0000 883.5994 208.1624 .2954 .0044 .6488
19.0000 786.1833 735.5757 .2028 .0176 1.3881
20.0000 2022.7322 520.5920 .2423 .0047 1.5216
21.0000 2405.3198 628.1454 .3437 .0066 .6965
[color=FF0000]请教各位编程高手,程序改如何编写。需要注意什么?非常感谢[/color]
1.0000 932.7000 219.2000 .1120 .0054 .5100 472.6800
2.0000 945.1000 282.7000 .3680 .0123 .5900 1004.5300
3.0000 982.3000 342.7000 .2970 .0169 .6400 1575.2600
4.0000 882.6000 236.1000 .0810 .0087 1.4300 3845.1300
5.0000 918.8000 317.1000 .1460 .0088 .8300 4219.6500
6.0000 875.1000 744.0000 .2300 .0111 1.1300 4458.9800
7.0000 1015.9000 539.7000 .1600 .0148 1.0500 4604.1200
8.0000 921.6000 373.4000 .2030 .0051 1.7000 4777.0200
9.0000 852.2000 690.9000 .0640 .0120 1.2000 5590.5500
10.0000 935.0000 700.0000 .2350 .0095 1.2000 6305.4100
11.0000 842.5000 640.7000 .1790 .0160 .8700 6334.6800
12.0000 1003.5000 653.5000 .0980 .0142 1.3100 6476.4600
[color=FF0000][color=C0C0C0]“rsm-2.txt”数据如下:[/color][/color]
13.0000 1502.9142 665.8377 .2984 .0114 .4418
14.0000 834.5303 451.6431 .1350 .0123 1.7683
15.0000 2162.6292 507.3860 .2752 .0073 1.4777
16.0000 752.7414 377.8538 .1560 .0064 .6650
17.0000 2251.9001 187.7713 .3240 .0066 .8568
18.0000 883.5994 208.1624 .2954 .0044 .6488
19.0000 786.1833 735.5757 .2028 .0176 1.3881
20.0000 2022.7322 520.5920 .2423 .0047 1.5216
21.0000 2405.3198 628.1454 .3437 .0066 .6965
如果我想把这个两个txt文档中的数据提取出来,合并成一个文档rsm.txt输出,其格式如下:
1.0000 932.7000 219.2000 .1120 .0054 .5100 472.6800
2.0000 945.1000 282.7000 .3680 .0123 .5900 1004.5300
3.0000 982.3000 342.7000 .2970 .0169 .6400 1575.2600
4.0000 882.6000 236.1000 .0810 .0087 1.4300 3845.1300
5.0000 918.8000 317.1000 .1460 .0088 .8300 4219.6500
6.0000 875.1000 744.0000 .2300 .0111 1.1300 4458.9800
7.0000 1015.9000 539.7000 .1600 .0148 1.0500 4604.1200
8.0000 921.6000 373.4000 .2030 .0051 1.7000 4777.0200
9.0000 852.2000 690.9000 .0640 .0120 1.2000 5590.5500
10.0000 935.0000 700.0000 .2350 .0095 1.2000 6305.4100
11.0000 842.5000 640.7000 .1790 .0160 .8700 6334.6800
12.0000 1003.5000 653.5000 .0980 .0142 1.3100 6476.4600
13.0000 1502.9142 665.8377 .2984 .0114 .4418
14.0000 834.5303 451.6431 .1350 .0123 1.7683
15.0000 2162.6292 507.3860 .2752 .0073 1.4777
16.0000 752.7414 377.8538 .1560 .0064 .6650
17.0000 2251.9001 187.7713 .3240 .0066 .8568
18.0000 883.5994 208.1624 .2954 .0044 .6488
19.0000 786.1833 735.5757 .2028 .0176 1.3881
20.0000 2022.7322 520.5920 .2423 .0047 1.5216
21.0000 2405.3198 628.1454 .3437 .0066 .6965
[color=FF0000]请教各位编程高手,程序改如何编写。需要注意什么?非常感谢[/color]