找回密码
 注册
搜索
[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
查看: 21672|回复: 11

[文本处理] 求助求助!各位大神帮小弟解决一下难题,我不知道我错在哪里了!

[复制链接]
发表于 2020-5-29 01:00:48 | 显示全部楼层 |阅读模式
我是新手,我是真的不知道错在哪里,就是生成不了ping_report.txt报告
求大神帮忙,拜托拜托~!! :handshake :handshake


代码在附件中~~~
 楼主| 发表于 2020-5-29 01:05:54 | 显示全部楼层
各位大佬救救我!!!!
 楼主| 发表于 2020-5-29 01:13:15 | 显示全部楼层
我ping_scom可以运行,并且能存在我创建的log文件夹中,但接下来我就不知道我错在哪里了,ping_aly就是生成不了ping_report.txt报告。
发表于 2020-5-29 06:31:27 | 显示全部楼层
本帖最后由 flashercs 于 2020-5-29 06:33 编辑

ping_aly_base.txt
  1. FOR /F "tokens=1-2 delims= " %%i IN (C:\Users\Administrator\Desktop\scom\log\%1_scom_1_A.txt) DO if %%j==timed echo %1_%3 _scom_1_A is timeout>>ping_report.txt
  2. FOR /F "tokens=1-2 delims= " %%i IN (C:\Users\Administrator\Desktop\scom\log\%1_scom_2_A.txt) DO if %%j==timed echo %1_%3 _scom_2_A is timeout>>ping_report.txt
  3. FOR /F "tokens=1-2 delims= " %%i IN (C:\Users\Administrator\Desktop\scom\log\%1_scom_3_A.txt) DO if %%j==timed echo %1_%3 _scom_3_A is timeout>>ping_report.txt
  4. FOR /F "tokens=1-2 delims= " %%i IN (.\log\%1_scom_4_A.txt) DO if %%j==timed echo %1_%3 _scom_4_A is timeout>>ping_report.txt
  5. FOR /F "tokens=1-2 delims= " %%i IN (.\log\%1_scom_5_A.txt) DO if %%j==timed echo %1_%3 _scom_5_A is timeout>>ping_report.txt
  6. FOR /F "tokens=1-2 delims= " %%i IN (.\log\%1_scom_6_A.txt) DO if %%j==timed echo %1_%3_ scom_6_A is timeout>>ping_report.txt

  7. FOR /F "tokens=1-5 delims= " %%i IN (.\log\%1_scom_1_A.txt) DO if %%j==from if %%l==Destination echo %1_%3 _scom_1_A is Destinationecho>>ping_report.txt
  8. FOR /F "tokens=1-5 delims= " %%i IN (.\log\%1_scom_2_A.txt) DO if %%j==from if %%l==Destination echo %1_%3 _scom_2_A is Destinationecho>>ping_report.txt
  9. FOR /F "tokens=1-5 delims= " %%i IN (.\log\%1_scom_3_A.txt) DO if %%j==from if %%l==Destination echo %1_%3 _scom_3_A is Destinationecho>>ping_report.txt
  10. FOR /F "tokens=1-5 delims= " %%i IN (.\log\%1_scom_4_A.txt) DO if %%j==from if %%l==Destination echo %1_%3 _scom_4_A is Destinationecho>>ping_report.txt
  11. FOR /F "tokens=1-5 delims= " %%i IN (.\log\%1_scom_5_A.txt) DO if %%j==from if %%l==Destination echo %1_%3 _scom_5_A is Destinationecho>>ping_report.txt
  12. FOR /F "tokens=1-5 delims= " %%i IN (.\log\%1_scom_6_A.txt) DO if %%j==from if %%l==Destination echo %1_%3_ scom_6_A is Destinationecho>>ping_report.txt

复制代码
另外%3是否改为%2呢?
 楼主| 发表于 2020-5-29 08:53:41 | 显示全部楼层
回复 4# flashercs


不行啊,还是输出不了txt
发表于 2020-5-29 09:02:48 | 显示全部楼层
回复 5# katry


    先去掉 >>ping_report.txt 试试
 楼主| 发表于 2020-5-29 09:11:00 | 显示全部楼层
我主要及时不能输出ping_report.txt
我感觉其他都是好的
 楼主| 发表于 2020-5-29 09:11:19 | 显示全部楼层
回复 6# flashercs


   
我主要及时不能输出ping_report.txt
我感觉其他都是好的
发表于 2020-5-29 09:25:13 | 显示全部楼层
回复 8# katry

那就是路径问题 ping_report.txt,改成绝对路径试试,例如:>>d:\test\ping_report.txt
 楼主| 发表于 2020-5-29 09:55:23 | 显示全部楼层
回复 9# flashercs


  不行,还是没有
发表于 2020-5-29 10:25:16 | 显示全部楼层
回复 10# katry


    有没有觉得很诡异?外星人恶作剧
 楼主| 发表于 2020-5-29 10:28:56 | 显示全部楼层
回复 11# flashercs


    我觉得我语法什么都没错吧,就是输出不了txt
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|批处理之家 ( 渝ICP备10000708号 )

GMT+8, 2026-3-20 23:07 , Processed in 0.035084 second(s), 17 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表