本帖最后由 慕夜蓝化 于 2015-1-27 18:34 编辑
a b.txt文本:- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- 12256
- Saber555
- 5666888
- 233SABER
- kinl
复制代码 以上是a b.txt的文本内容- @echo off
- for /f "delims=" %%i in ('findstr .* ^<"a b.txt"') do echo,%%i
- pause
复制代码 运行后里面就一个光标在闪,其余什么都没有?
然后在,命令提示符下:- C:\Users\Administrator\Desktop\CES>findstr .* <"a b.txt"
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- 12256
- Saber555
- 5666888
- 233SABER
- ^C
- C:\Users\Administrator\Desktop\CES>type "a b.txt"|findstr .*
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- laizixinshijie
- 12256
- Saber555
- 5666888
- 233SABER
- kinl
-
- C:\Users\Administrator\Desktop\CES>findstr "^[0-9]*$" "a b.txt"
- 12256
- 5666888
-
- C:\Users\Administrator\Desktop\CES>
复制代码 这里findstr 之后的 < 有问题吗?为什么之前都可以运行呢?- @echo off
- for /f "delims=" %%i in ('findstr "^[0-9]*$" ^<"a b.txt"') do echo,%%i
- pause
复制代码 之前在批处理中测试都好好的,为什么现在就一个黑窗口;最后把那个^<去掉了,然后一切都好了。>_<
可我之前测试的时候也在批处理中加了 ^< 一切都正常啊。
最后是在a b.txt 文本的最后一行添加了
HHHHHHH
就开始不能用这种写法了。
findstr 精分了? |