[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文件操作] [已解决]批处理如何修改文件中的日期为当前日期呢?

附件是个 test.fqf 文件,.fqf 是flashfxp的队列文件,我每天用计划任务备份网站当天产生的内容,所以每天都要手动修改队列里面的日期为当天日期,所以看看批处理能不能解决这个问题。

test.fqf 的内容里面有ASCII 1,但是不管,只修改日期部分,如图:
  1. 14-F9A58688aabbE:\www\web\2014-07\29/wwwroot/web/2014-07/29324537100
复制代码


关于.fqf文件格式官方文档说明:
  1. Queue Format (.fqf)
  2. Queue file format (.fqf) for reference.
  3. Each line consists of a single queue item and the fields separated by the (ASCII 1) character. Each line ends with a CR/LF.
  4. Type
  5. 0 = file
  6. 1 = folder
  7. 2 = action file
  8. 3 = action folder
  9. 4 = action other
  10. Transfer Direction
  11. 0 = -->
  12. 1 = <--
  13. 2 = Up Left
  14. 3 = Down Left
  15. 4 = Up Right
  16. 5 = Down Right
  17. 10+ =  failed transfer
  18. When generating a queue file externally you can use the site name as shown in the site manager. Site names start with a (ASCII 2). Queue files created by FlashFXP start with (ASCII 3) followed by a 32bit hash in Hex format (8 characters in length) immediately followed by the site name.
  19. For a FTP transfer you use - (ASCII 45) to identify the the local side.
  20. Each line consists of the following fields separated by (ASCII 1)
  21. 1. Type
  22. 2. Direction
  23. 3. Source Host (site name, see #1)
  24. 4. Target Host (site name, see #1)
  25. 5. Source Filename (full path to source)
  26. 6. Target Filename (full path to target)
  27. 7. File Size
  28. A line would consist of the following
  29. <Type><ASCII 1><Direction><ASCII 1><Source Host><ASCII 1><Target Host><ASCII 1><Source Filename><ASCII 1><Target Filename><ASCII 1><File Size><CR><LF>
  30. #1: The easiest way to obtain the site name is to open the sites.dat file in a text editor, the site name is the section name for the site and copy and paste the text because it includes special characters for group names, to make it easier, sites that you need to manually create queues for, you can simply create them in the root of the site manager so no group is used. this way they can be accessed directly by name shown in the site manager.
复制代码
附件: 您需要登录才可以下载或查看附件。没有帐号?注册
1

评分人数

    • Batcher: 感谢给帖子标题标注[已解决]字样PB + 2

试了解决不了

TOP

  1. ::修改时间格式
  2. reg add "HKEY_CURRENT_USER\Control Panel\International" /v sShortDate /t REG_SZ /d yyyy-M-d /f>nul
  3. sed -i "s/[0-9]\{4\}-[0-9][0-9]\\[0-9][0-9]/%date:~0,7%\\%date:~8,2%/";"s/[0-9]\{4\}-[0-9][0-9]\/[0-9][0-9]/%date:~0,7%\/%date:~8,2%/" test.fqf
复制代码
sed 自行在本论坛下载
1

评分人数

“阿姐走了。。。可是。。。我。。。我愿意。”

TOP

回复 3# hfg1977


    解决了,谢谢,要适应右下角新日期了。

TOP

返回列表