有文件1.txt
-176.250000 89.750000
-175.750000 89.750000
-175.250000 89.750000
-174.750000 89.750000
-174.250000 89.750000
和文件2.txt
-179.750000 89.750000 0.936815
-179.250000 89.750000 0.936815
-178.750000 89.750000 0.937381
-178.250000 89.750000 0.937381
-177.750000 89.750000 0.936225
-177.250000 89.750000 0.936225
-176.750000 89.750000 0.925175
-176.250000 89.750000 0.925175
-175.750000 89.750000 0.930261
-175.250000 89.750000 0.930261
-174.750000 89.750000 0.927604
-174.250000 89.750000 0.927604
-173.750000 89.750000 0.915246
-173.250000 89.750000 0.915246
-172.750000 89.750000 0.914859
-172.250000 89.750000 0.914859
-171.750000 89.750000 0.912408
-171.250000 89.750000 0.912408
-170.750000 89.750000 0.914096
-170.250000 89.750000 0.914096
-169.750000 89.750000 0.916220
怎样根据1.txt中的每行数据找到2.txt中对应行的第三列数据并输出到3.txt啊。- @echo off
- For /F "tokens=1,2 delims= " %%i In (1.txt) do
- ( For /F "tokens=1,2,3 delims= " %%a In (2.txt) do ( if %%a%%b EQU %%i%%j echo %%c) )>>3.txt
- pause>nul
复制代码 我自己试写的代码运行不起来,请各位大侠看看怎么回事啊!!! |