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

[文本处理] 批处理如何截取字符串到另外一个文本?

例如有一个log文件的内容是:
  1. <head>
  2. <meta http-equiv="Content-Type" content="text/html; charset=gbk" />
  3. <title> 批处理之家 批处理_BAT脚本_PowerShell_VBS_CMD_DOS_Perl_Python - Powered by Discuz!</title>
  4. <meta name="keywords" content="批处理,批处理命令,批处理教程,BAT,BAT脚本,CMD,DOS,VBS,VBScript,JScript,JavaScript,Perl,Python,PowerShell" />
  5. <meta name="description" content=" 批处理之家 批处理之家是中国最实用的批处理论坛.由批处理,DOS,VBS,JScript,JavaScript,Perl,Python,PowerShell等版块组成.涵盖批处理删除文件,DOS命令大全,CMD命令大全,清理系统垃圾bat,VBS整人代码破解等实用信息.众多脚本高手帮助你及时解决各种问题. - Discuz! Board" />
  6. <meta name="generator" content="Discuz! 7.2" />
  7. <meta name="author" content="Discuz! Team and Comsenz UI Team" />
  8. <meta name="copyright" content="2001-2009 Comsenz Inc." />
  9. <meta name="MSSmartTagsPreventParsing" content="True" />
  10. <meta http-equiv="MSThemeCompatible" content="Yes" />
  11. <meta http-equiv="x-ua-compatible" content="ie=7" />
  12. <link rel="archives" title="批处理之家" href="http://www.bathome.net/archiver/" />
  13. <link rel="stylesheet" type="text/css" href="forumdata/cache/style_1_common.css?VK8" /><link rel="stylesheet" type="text/css" href="forumdata/cache/scriptstyle_1_search.css?VK8" />
  14. <script type="text/javascript">var STYLEID = '1', IMGDIR = 'images/default', VERHASH = 'VK8', charset = 'gbk', discuz_uid = 72104, cookiedomain = '', cookiepath = '/', attackevasive = '0', disallowfloat = 'newthread|reply|viewvote|tradeorder|activity|debate', creditnotice = '', gid = 0, fid = parseInt('0'), tid = parseInt('0')</script>
  15. <script src="forumdata/cache/common.js?VK8" type="text/javascript"></script>
  16. </head>
复制代码
是否可以截取
  1. <meta name="author" content="Discuz! Team and Comsenz UI Team" />
  2. <meta name="copyright" content="2001-2009 Comsenz Inc." />
  3. <meta name="MSSmartTagsPreventParsing" content="True" />
复制代码
这三条内容到另外一个文本文档内?
可以只用批处理吗?不用PowerShell。用PowerShell会导致乱码。

findstr "MSSmartTagsPreventParsing author copyright" log.log

TOP

返回列表