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

[文件操作] 批处理如何删除文本中含有指定字符串的行?

bat脚本循环嵌套的问题
大致目的是删除一组文件中包含一组关键词中任意一个所在行的文本。
就是判定某一文本文件中的某一行是否包含关键字,若包含则不保留,包含则输出到另一路径下的同名文件
  1. for /f %%i in (一组文件) do (
  2. for /f %%j in (%%i) do (
  3. for /f %%k in (一组关键词.txt) do (
  4. echo %%j | find /v "%%k">>新路径\%%i
  5. )))
复制代码
但是循环不论如何嵌套输出里面都会有重复,求解

回复  zaqmlp
没太懂,请问如何输出到文件呢?以及文本文件编码不同,UTF-8编码使用/i开关好像会乱码,求 ...
cby120 发表于 2018-6-17 20:30
  1. findstr /ivg:关键词.log test.txt >输出.txt
复制代码

TOP

请问有vbs 实现的方法吗

TOP

  1. findstr /iv "Dialogue.*p0}" 1.txt>>2.txt
  2. findstr /i "Dialogue.*p0}" 1.txt>>3.txt
复制代码
目的,学习批处理

TOP

不要带有{\p0}的行

TOP

然后呢,,你是不要内容中的什么,还是要保留什么?是一个文件,还是一堆文件?
目的,学习批处理

TOP

本帖最后由 cby120 于 2018-6-17 21:54 编辑

不好意思。。我也想传样本。。附件大小限50k。。我粘一段。。
&字符主要出现在色标里面,line8,12,13,14...
来自字幕
  1. [Aegisub Project Garbage]
  2. Scroll Position: 13
  3. Active Line: 20
  4. Video Position: 19066
  5. [V4+ Styles]
  6. Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
  7. Style: Default,方正黑体_GBK,20,&H00FFFFFF,&HF0000000,&H00000000,&H32000000,0,0,0,0,100,100,0,0,1,2,1,2,5,5,2,134
  8. [Events]
  9. Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
  10. Dialogue: 0,0:00:01.18,0:00:07.02,*Default,NTP,0,0,0,,{\bord0\shad0\b1\fs46\t(\fs38)\fad(1300,0)\c&H6197C1&\t(0,2110,\c&HA6BDC7&\t(1190,1732,\c&HB8BBBF&\t(4527,4902,\c&HE1E1E3&\an8\move(190,200,192,190)\fn方正大黑_GBK}漫威出品
  11. Dialogue: 0,0:03:54.42,0:03:55.79,*Default,,0,0,0,,{\fad(300,0)\fs34\t(\fs44)\fscy80\an8\c&H090C24&\t(0,940,\c&H090C2A&)\t(940,1350,\c&H2E335D&)\bord0\xshad0\yshad-4\4c&H0A0B0A&\frx300\t(0,1357,\frx360)\move(189.6,176.984,189.6,190.257,0,1357)}神盾局特工\N{\fs22\t(\fs27)}第四季 第一集
  12. Dialogue: 0,0:03:55.79,0:03:56.88,*Default,,0,0,0,,{\an8\fs44\t(\fs66)\fscy80\c&H2E335D&\t(\c&H373B51&)\bord0\xshad0\yshad-4\4c&H0A0B0A&\move(189.6,190.257,189.6,208.877,0,1072)}神盾局特工\N{\fs27\t(\fs42)}第四季 第一集
  13. Dialogue: 0,0:03:56.88,0:03:57.46,*Default,,0,0,0,,{\fscy80\fs66\t(\fs90)\an8\c&H373B51&\t(\c&H292F44&)\bord0\xshad0\yshad-4\4c&H0A0B0A&\move(189.6,208.877,189.6,236.122,0,566)}神盾局特工\N{\fs42\t(\fs58)}第四季 第一集
  14. Dialogue: 0,0:03:57.46,0:03:57.96,*Default,,0,0,0,,{\fscy80\fs90\t(\fs140)\an8\c&H292F44&\bord0\xshad0\yshad-4\4c&H0A0B0A&\move(189.6,236.122,189.6,280.77,0,486)}神盾局特工
  15. Dialogue: 2,0:00:07.44,0:00:32.47,*Default,NTP,0,0,0,,{\fad(500,0)\bord0\shad0\fscx11\fscy14\p1\c&H010403&\t(24800,25000,\fscx0\fscy0)\pos(20,282.173)}m 20 0 l 209 0 b 218 0 229 11 229 20 l 229 209 b 229 218 218 228 209 228 l 20 228 b 11 228 0 218 0 209 l 0 20 b 0 11 11 0 20 0{\p0}
  16. Dialogue: 3,0:00:07.44,0:00:32.47,*Default,NTP,0,0,0,,{\fad(500,0)\bord0\shad0\fscx16\fscy20\p1\c&H9297A1&\t(24800,25000,\fscx0\fscy0)\pos(5.74,267.6)}m 195 227 l 228 227 l 149 147 m 149 86 l 134 100 l 241 210 l 241 180 m 195 71 l 89 180 l 89 210 l 89 210 l 225 71 m 134 71 l 89 117 l 89 147 l 163 71 m 134 164 l 195 227 l 228 227 l 150 148 m 149 86 l 134 100 l 241 210 l 241 177 m 195 71 l 89 180 l 89 210 l 89 210 l 225 71 m 134 71 l 89 117 l 89 147 {\p0}
  17. Dialogue: 5,0:00:07.44,0:00:32.47,*Default,NTP,0,0,0,,{\fad(500,0)\bord0\shad0\fscx19\fscy20\p1\1a&H3D&\c&HFFFFFF&\blur10\t(24800,25000,\fscx0\fscy0)\pos(7.1,274.2)}m 71 60 b 71 0 161 0 161 60 b 161 120 71 120 71 60{\p0}
  18. Dialogue: 1,0:00:07.44,0:00:12.45,*Default,NTP,0,0,0,,{\fad(500,500)\bord0\shad0\fscx17\blur20\fscy22\p1\c&HFFFFFF&\t(0,1000,1,\blur0)\pos(65.9,281.2)}m 330 133 l 343 133 l 343 125 l 330 125 m 330 122 l 343 122 l 343 115 l 330 115 m 330 112 l 343 112 l 343 104 l 330 104 m 322 136 l 322 133 l 327 133 l 327 101 l 346 101 l 346 133 l 350 133 l 350 136 m 316 121 b 316 121 316 121 316 121 b 316 121 320 121 323 121 b 323 121 323 123 323 123 b 318 124 315 124 311 125 l 311 122 b 311 122 317 114 317 114 b 317 114 317 114 317 114 b 316 113 310 115 310 115 l 310 112 b 310 112 317 99 317 99 l 320 100 b 317 105 316 107 314 112 b 313 112 314 112 313 112 b 320 112 322 105 322 105 l 325 107 b 325 107 316 121 316 121 m 310 131 b 313 131 318 130 324 129 l 324 131 b 319 132 315 133 310 134 m 296 126 b 296 125 293 124 293 123 l 288 123 l 288 126 m 281 123 b 280 123 277 126 277 126 l 285 126 l 285 123 m 276 116 l 298 116 l 298 113 l 276 113 m 276 111 l 298 111 l 298 109 l 276 109 m 291 99 l 294 99 l 294 101 l 306 101 l 305 104 l 294 104 l 294 106 l 291 106 l 291 104 l 282 104 l 282 106 l 279 106 l 279 104 l 268 104 l 268 101 l 279 101 l 279 98 l 282 98 l 282 101 l 291 101 m 268 120 l 278 120 b 280 119 280 119 278 120 b 280 119 280 119 280 119 l 272 119 l 272 106 l 301 106 l 301 118 l 287 118 b 285 118 284 119 283 120 l 305 120 l 305 123 l 297 123 b 299 123 297 123 307 128 b 306 128 307 128 305 131 b 301 128 300 128 300 128 l 300 130 b 300 134 297 135 297 135 l 291 135 b 291 135 291 135 291 132 b 291 132 291 133 291 133 b 292 132 292 132 297 132 b 297 130 297 130 297 131 l 297 129 l 288 129 l 288 138 l 285 138 l 285 129 l 277 129 l 277 136 l 274 136 l 274 127 b 274 127 274 127 268 131 b 268 131 268 131 266 129 b 266 129 272 125 276 123 l 268 123 m 244 98 l 244 98 b 244 98 246 103 247 104 l 244 104 l 263 104 l 263 112 l 259 112 l 259 108 l 229 108 l 229 113 l 225 113 l 225 104 l 244 104 b 244 104 241 99 244 104 b 244 104 241 99 241 99 m 242 119 l 251 115 l 231 115 l 231 112 l 256 112 l 256 116 l 246 121 l 246 122 l 264 122 l 264 125 l 246 125 l 246 129 b 246 134 246 137 243 138 l 235 138 b 235 138 234 134 234 134 b 236 134 236 134 242 134 b 242 134 242 130 242 130 l 242 125 l 224 125 l 224 122 l 242 122 m 210 58 l 192 58 l 192 54 l 210 54 m 225 55 l 239 56 l 261 28 l 245 28 l 225 53 b 224 49 221 45 216 46 l 178 46 l 178 66 l 193 66 l 193 77 l 189 77 l 191 68 l 178 68 l 174 87 l 188 87 l 190 81 l 193 87 l 209 87 l 209 66 l 225 66 m 192 19 l 210 19 l 210 21 l 192 21 m 192 9 l 210 9 l 210 12 l 192 12 m 228 34 l 210 34 l 209 31 l 226 31 l 226 27 l 238 27 l 261 0 l 244 0 l 226 22 l 225 22 l 225 6 b 225 3 224 0 217 0 l 177 0 l 176 30 l 193 30 l 193 34 l 174 34 l 174 43 l 227 43 m 246 57 l 226 79 l 224 69 l 212 69 l 215 85 l 223 84 l 222 87 l 238 87 l 261 57 m 336 77 l 336 59 l 329 58 l 329 14 l 315 14 l 315 49 l 291 87 l 306 87 l 324 58 l 324 87 l 346 87 l 350 77 m 310 10 l 334 10 l 335 56 l 345 56 l 345 6 b 345 4 343 0 339 0 l 298 0 l 298 56 l 310 56 m 295 36 l 286 36 l 295 21 l 295 10 l 288 10 l 284 0 l 267 0 l 272 10 l 261 10 l 261 20 l 279 20 l 260 51 l 270 51 l 270 86 l 283 87 l 283 42 l 285 39 l 287 64 l 297 64 m 155 87 l 129 35 l 104 87 l 84 87 l 128 0 l 146 0 l 132 30 l 146 30 l 174 87 m 66 87 l 39 35 l 14 87 l -5 87 l 38 0 l 56 0 l 42 30 l 56 30 l 84 87 m 203 138 l 199 138 l 190 111 l 194 111 l 201 133 b 201 134 201 134 201 133 l 209 111 l 213 111 m 188 135 l 188 137 b 183 137 188 137 183 137 b 183 137 179 138 179 134 l 179 115 l 176 115 l 176 111 l 179 111 l 179 104 l 183 103 l 183 111 l 187 111 l 187 115 l 183 115 l 183 135 b 183 135 183 135 188 135 m 166 132 l 171 132 l 171 137 l 166 137 m 154 111 l 158 111 l 158 137 l 155 137 l 155 133 b 153 136 151 138 145 137 b 143 138 139 137 136 132 l 136 111 l 140 111 l 140 127 b 140 131 139 134 146 135 b 151 135 153 132 154 128 m 110 134 l 132 134 l 132 137 l 104 137 l 104 135 l 126 105 l 107 105 l 107 102 l 131 102 l 131 105 m 96 111 l 100 111 l 100 137 l 97 137 l 97 133 b 94 135 93 138 88 138 b 85 138 81 136 79 130 l 79 111 l 83 111 l 83 130 b 84 133 86 135 89 135 b 94 135 97 130 96 123 m 69 107 l 57 137 l 54 137 l 42 107 l 42 137 l 38 137 l 38 102 l 43 102 l 56 132 l 67 102 l 73 102 l 73 137 l 69 137 m 27 111 l 31 111 l 31 137 l 27 137 m 27 102 l 31 102 l 31 106 l 27 106 m 0 135 l 23 135 l 23 137 l -5 137 l -5 135 l 17 105 l -3 105 l -3 102 l 22 102 l 22 104 {\p0}
  19. Dialogue: 0,0:00:08.44,0:00:12.45,*Default,NTP,0,0,0,,{\fad(500,500)\fs14\fn方正准圆_GBK\b1\bord0\shad0\clip(98,154,98,373)\t(0,1000,1,\clip(98,154,218,375))\t(3500,4000,\clip(98,154,98,373)\pos(158.4,282.6)}仅供学习  禁止商用  更多影视\N{\fs18}登陆{\fn方正综艺_GBK\c&H9297A1&}www.ZiMuZu.tv
  20. Dialogue: 0,0:00:12.45,0:00:17.45,*Default,,0,0,0,,{\fad(0,500)\an4\bord0\b1\clip(34,1,398,281)\move(-250,266,34.8,266,0,500)\fs17\fn方正仿宋繁体}翻译 {\fs20\fn方正小标宋_GBK}王大可   杏仁斯嘉丽   酸奶醒不来   胡说大王   累
  21. Dialogue: 0,0:00:17.45,0:00:22.45,*Default,,0,0,0,,{\fad(0,500)\an4\bord0\b1\clip(34,1,398,281)\move(-250,266,34.8,266,0,500)\fs17\fn方正仿宋繁体}翻译 {\fs20\fn方正小标宋_GBK}milkon   小暴徒   Silence   dzysteven   *PiPi*
  22. Dialogue: 0,0:00:22.45,0:00:27.45,*Default,,0,0,0,,{\fad(0,500)\an4\bord0\b1\clip(34,1,398,281)\move(-250,266,34.8,266,0,500)\fs17\fn方正仿宋繁体}时间轴 {\fs20\fn方正小标宋_GBK}念念不忘浓子   Avis想念浓子   苏菲
  23. Dialogue: 0,0:00:27.46,0:00:32.46,*Default,,0,0,0,,{\fad(0,500)\an4\bord0\b1\clip(34,1,398,281)\move(-250,266,34.8,266,0,500)\fs17\fn方正仿宋繁体}翻译&校对&总监 {\fs20\fn方正小标宋_GBK}{\c&H3CC43C&}草草{\c&HFFFFFF&}   {\fs17\fn方正仿宋繁体}后期 {\fs20\fn方正小标宋_GBK}饿得慌
  24. Dialogue: 0,0:07:01.35,0:07:02.23,*Default,NTP,0,0,0,,{\fs14\t(30,110,\fs24)\fscx80\fay0.034\fad(0,350)\bord0\shad2\fn方正兰亭粗黑_GBK\c&HFCFDF8&\4c&HBAAFC9&\pos(144.6,137.2)\b1}准许进入
  25. Dialogue: 0,0:13:13.31,0:13:15.02,*Default,NTP,0,0,0,,{\fad(0,270)\fscx80\fax-0.3\fsp2\fs13\an1\bord0\shad0\fn方正兰亭中黑_GBK\frz356.1\pos(132,42.8)\c&HC9AC78&}搜索
  26. Dialogue: 0,0:13:13.31,0:13:15.02,*Default,NTP,0,0,0,,{\fad(0,270)\fs8\fscx80\an7\bord2\shad0\blur4\fn方正兰亭中黑_GBK\c&HC8AD85&\frz355.8\pos(74.1,74.4)\3c&H070503&}存疑死亡  烧伤  可疑死亡  东{\K80}洛杉矶
  27. Dialogue: 0,0:13:14.52,0:13:16.65,*Default,NTP,0,0,0,,{\fs9\fscx80\fax-0.36\an1\bord0\shad0\fn方正兰亭中黑_GBK\frz357.1\c&HAE8E57&\t(30,66,\c&HD2BD86&)\b1\move(237.3,47.6,236.4,44.8,150,734)}搜索结果
  28. Dialogue: 0,0:13:14.60,0:13:16.56,*Default,,0,0,0,,{\fscx80\fax-0.18\fs9\an1\bord0\shad0\frz356.3\fn方正兰亭中黑_GBK\c&HDAC69E&\b1\move(303,67.6,301.5,64.4,70,695)}胡桃公园凶杀频发
  29. Dialogue: 0,0:13:14.64,0:13:16.56,*Default,,0,0,0,,{\fad(70,0)\fscx80\fax-0.14\fs9\an1\bord0\shad0\fn方正兰亭中黑_GBK\c&HDAC69E&\b1\move(240.9,110.4,240,107.6,71,655)\frz356}西柯汶纳小联盟球场发现不明尸体
  30. Dialogue: 0,0:13:14.81,0:13:16.56,*Default,,0,0,0,,{\fscx80\fax-0.1\fs9\an1\bord0\shad0\fn方正兰亭中黑_GBK\c&HDAC69E&\b1\frz356.1\move(255.4,158.8,255.7,156,110,402)}本地议员死在建筑工地外
  31. Dialogue: 0,0:13:14.81,0:13:16.65,*Default,,0,0,0,,{\fscx80\fax-0.1\fs9\an1\bord0\shad0\fn方正兰亭中黑_GBK\c&HDAC69E&\b1\frz355\move(194.6,182,193.7,180,152,444)}深受信赖的老师被杀  家被烧毁
  32. Dialogue: 0,0:13:16.73,0:13:17.94,*Default,NTP,0,0,0,,{\fs14\fax-0.13\fscx90\an7\bord0\shad0\frz356.4\fn方正兰亭中黑_GBK\c&H251000&\move(220.8,54,229.2,44,275,1068)}深受信赖的老师被杀  家被烧毁
  33. Dialogue: 0,0:13:23.53,0:13:24.95,*Default,NTP,0,0,0,,{\fad(0,190)\fs10\fax-0.1\fscy95\an7\bord0\shad0\frz351.7\pos(239.7,120.8)}橘线63B  早上九点
  34. Dialogue: 0,0:13:27.07,0:13:28.32,*Default,NTP,0,0,0,,{\fs30\bord0\shad0\frz350.3\fn方正咆哮简体\c&H13131A&\pos(146.7,124)}家政费
  35. Dialogue: 0,0:14:28.89,0:14:29.89,*Default,NTP,0,0,0,,{\fs14\fax0.22\fscy80\an1\bord0\shad0\frz0.6671\pos(73.5,266.8)\b1\c&HE7F8B2&}米切尔
  36. Dialogue: 0,0:17:15.13,0:17:15.68,*Default,NTP,0,0,0,,{\an1\fax-0.1\fscx90\bord0\shad0\c&HF2E2C9&\fn方正兰亭中黑_GBK\move(88.2,225.6,63.6,229.2,150,531)\frz6.525\t(\frz7.121\fax-0.12)}联赛杯总决赛
  37. Dialogue: 0,0:17:15.68,0:17:16.05,*Default,NTP,0,0,0,,{\fad(0,150)\an1\fscx90\bord0\shad0\c&HF2E2C9&\fn方正兰亭中黑_GBK\move(63.6,229.2,1.5,232.8,0,356)\frz7.121\fax-0.12\t(\frz8.051\fax-0.17)}联赛杯总决赛
  38. Dialogue: 0,0:20:31.16,0:20:33.75,*Default,NTP,0,0,0,,{\fax-0.11\fs18\an8\bord3\shad0\blur4\pos(201.9,50)\frz11.04\c&HA5C6B3&\3c&H3C3437&}橘线63B
  39. Dialogue: 0,0:24:40.83,0:24:42.79,*Default,NTP,0,0,0,,{\fad(440,0)\an8\bord0\shad0\fn方正兰亭粗黑_GBK\c&H18151B&\pos(201.6,75.2)}卡诺洛\N{\fn方正粗活意简体}汽车
  40. Dialogue: 0,0:00:50.61,0:00:51.50,*Default,NTP,0,0,0,,来了\N{\fn微软雅黑\fs14}It's coming!
  41. Dialogue: 0,0:00:51.67,0:00:52.61,*Default,NTP,0,0,0,,做好准备\N{\fn微软雅黑\fs14}Get ready!
  42. Dialogue: 0,0:00:54.48,0:00:55.79,*Default,NTP,0,0,0,,走  快走\N{\fn微软雅黑\fs14}Go, man, go!
  43. Dialogue: 0,0:01:17.87,0:01:19.26,*Default,NTP,0,0,0,,打死它  杀了它\N{\fn微软雅黑\fs14}Get it. Kill it!
  44. Dialogue: 0,0:01:19.48,0:01:21.00,*Default,NTP,0,0,0,,见到动的东西就开火\N{\fn微软雅黑\fs14}Shoot anything that moves.
  45. Dialogue: 0,0:01:44.61,0:01:45.47,*Default,NTP,0,0,0,,救命\N{\fn微软雅黑\fs14}Help.
  46. Dialogue: 0,0:01:46.49,0:01:47.83,*Default,NTP,0,0,0,,他伤到我了\N{\fn微软雅黑\fs14}He -- he got me.
  47. Dialogue: 0,0:01:48.32,0:01:49.48,*Default,NTP,0,0,0,,他会把我们都杀光\N{\fn微软雅黑\fs14}He'll kill us all.
  48. Dialogue: 0,0:01:54.03,0:01:55.22,*Default,NTP,0,0,0,,把枪给我\N{\fn微软雅黑\fs14}Give me that damn thing.
  49. Dialogue: 0,0:01:56.41,0:01:57.33,*Default,NTP,0,0,0,,退后\N{\fn微软雅黑\fs14}Get back!
  50. Dialogue: 0,0:02:28.26,0:02:29.74,*Default,NTP,0,0,0,,开火  快开火\N{\fn微软雅黑\fs14}Shoot it! Shoot it now!
  51. Dialogue: 0,0:03:06.10,0:03:06.94,*Default,NTP,0,0,0,,不\N{\fn微软雅黑\fs14}No!
  52. Dialogue: 0,0:03:07.63,0:03:09.99,*Default,NTP,0,0,0,,不  不  不\N{\fn微软雅黑\fs14}No! No! No!
  53. Dialogue: 0,0:03:10.63,0:03:12.11,*Default,NTP,0,0,0,,不  求你了\N{\fn微软雅黑\fs14}No! No, please!
  54. Dialogue: 0,0:03:12.11,0:03:13.11,*Default,NTP,0,0,0,,不\N{\fn微软雅黑\fs14}No!
  55. Dialogue: 0,0:04:05.25,0:04:07.59,*Default,NTP,0,0,0,,想活命你就得牺牲一切\N{\fn微软雅黑\fs14}{\*}You need to sacrifice everything if you want to survive.
  56. Dialogue: 0,0:04:09.60,0:04:11.37,*Default,NTP,0,0,0,,真有趣  因为我打算...\N{\fn微软雅黑\fs14}That's funny. 'Cause I thought I would just...
  57. Dialogue: 0,0:04:14.34,0:04:15.66,*Default,NTP,0,0,0,,好吧  这也是种办法\N{\fn微软雅黑\fs14}Yeah, that's one way to go.
  58. Dialogue: 0,0:04:17.70,0:04:18.65,*Default,NTP,0,0,0,,想来瓶啤酒吗\N{\fn微软雅黑\fs14}Want a beer?
  59. Dialogue: 0,0:04:19.35,0:04:21.75,*Default,NTP,0,0,0,,现在才早上六点  你是海明威吗\N{\fn微软雅黑\fs14}It's 6:00 in the morning. What, are you Hemingway?
  60. Dialogue: 0,0:04:22.00,0:04:23.14,*Default,NTP,0,0,0,,真的吗\N{\fn微软雅黑\fs14}No, is that real?
  61. Dialogue: 0,0:04:23.42,0:04:24.52,*Default,NTP,0,0,0,,我们什么时候飞过北极的\N{\fn微软雅黑\fs14}When did we cross the North Pole?
  62. Dialogue: 0,0:04:24.52,0:04:25.60,*Default,NTP,0,0,0,,一小时前\N{\fn微软雅黑\fs14}An hour ago.
  63. Dialogue: 0,0:04:25.84,0:04:28.25,*Default,NTP,0,0,0,,我的天  在这上面太难算时间了\N{\fn微软雅黑\fs14}Oh, my gosh. It's hard to keep track in this thing.
  64. Dialogue: 0,0:04:28.25,0:04:29.43,*Default,NTP,0,0,0,,我们穿梭各个时区\N{\fn微软雅黑\fs14}We shouldn't have to stay on clock
  65. Dialogue: 0,0:04:29.43,0:04:30.69,*Default,NTP,0,0,0,,就不该在意时间了\N{\fn微软雅黑\fs14}when we're moving through time zones.
  66. Dialogue: 0,0:04:30.69,0:04:32.76,*Default,NTP,0,0,0,,这都...两天跨了三个大陆了吧\N{\fn微软雅黑\fs14}I mean, what is that -- three continents in two days?
  67. Dialogue: 0,0:04:32.76,0:04:35.37,*Default,NTP,0,0,0,,如果把柏林也算上  我们只在那里待了三小时\N{\fn微软雅黑\fs14}If you count Berlin. We were only there three hours.
  68. Dialogue: 0,0:04:35.76,0:04:37.53,*Default,NTP,0,0,0,,是啊  我们一走进那间公寓\N{\fn微软雅黑\fs14}Yeah, we knew that Inhuman call was a hoax
  69. Dialogue: 0,0:04:37.53,0:04:40.13,*Default,NTP,0,0,0,,看见那个大麻烟斗  就知道异人报案是恶作剧了\N{\fn微软雅黑\fs14}as soon as we stepped foot in the apartment, saw that bong.
  70. Dialogue: 0,0:04:40.14,0:04:41.75,*Default,NTP,0,0,0,,我在楼道里就闻到了\N{\fn微软雅黑\fs14}I could smell it from the hallway.
  71. Dialogue: 0,0:04:41.75,0:04:44.04,*Default,NTP,0,0,0,,求关注的二货\N{\fn微软雅黑\fs14}Jokers. Hungry for attention.
  72. Dialogue: 0,0:04:44.04,0:04:45.31,*Default,NTP,0,0,0,,还渴求薯片\N{\fn微软雅黑\fs14}And potato chips.
  73. Dialogue: 0,0:04:45.31,0:04:46.62,*Default,NTP,0,0,0,,如果零食算是种超能力\N{\fn微软雅黑\fs14}If the munchies was a superpower,
  74. Dialogue: 0,0:04:46.62,0:04:49.00,*Default,NTP,0,0,0,,那他们都够格签《索科威亚协议》了\N{\fn微软雅黑\fs14}they'd be signing the Sokovia Accords as we speak.
  75. Dialogue: 0,0:04:51.19,0:04:52.55,*Default,NTP,0,0,0,,你应该让我帮你修整洛拉\N{\fn微软雅黑\fs14}You should let me work on Lola.
复制代码

TOP

这么多人累的哼哧哼哧的,楼主可以放个样本上来吗,,大家横竖在摸象。你表达清楚些
目的,学习批处理

TOP

还想问如何保留空行?

TOP

本帖最后由 cby120 于 2018-6-17 20:32 编辑

回复 12# zaqmlp
没太懂,请问如何输出到文件呢?以及文本文件编码不同,UTF-8编码使用/i开关好像会乱码,求解

TOP

  1. findstr /ivg:关键词.log 文本.txt
复制代码
提供bat代写,为你省时省力省事,支付宝扫码头像支付
微信: unique2random

TOP

回复 10# 0000 额其实是需要转义%j包含的&字符,测了有问题。。会报错,说&后面的。。。不是命令,也不是可执行文件。。。比如H00FFFFFF
输出到文本文件的内容就只有&前的字符

TOP

回复 8# cby120


    放心,%%j中不会出现&被转义的问题,可以测试一下

TOP

比如这一行
  1. Style: Default,方正黑体_GBK,20,&H00FFFFFF,&HF0000000,&H00000000,&H32000000,0,0,0,0,100,100,0,0,1,2,1,2,5,5,2,134
复制代码

TOP

现在依然有问题,就是待处理的文本包含&字符,在第11行echo的时候会被识别为command1&command2的格式,执行&后面的文本。但是也不能对文本里面的每一个&转义,echo也不能加双引号,会直接echo出来,如何避免变量%%j里面的&问题呢?

TOP

返回列表