我测试着可以~:)
CMD Shell 下直接输入命令运行测试:
C:\TEMP\str>for /f "tokens=3,5 delims== " %a in (sfhr.txt) do @echo %~a %~b
111111111111111 测试测试测试测试
111111111111112 杭州技术有限公司
9527兄在for命令里用的是一个%号(代表是直接在命令行上运行的,不能写到.bat文件中运行)。所以lanlinlan兄直接运行即可。
如果希望写到批处理文件内,就用双%号~:)
I can be tested ~ :)
Run the test by directly entering the command in the CMD Shell:
C:\TEMP\str>for /f "tokens=3,5 delims== " %a in (sfhr.txt) do @echo %~a %~b
111111111111111 Test Test Test Test
111111111111112 Hangzhou Technology Co., Ltd.
Brother 9527 used a single % sign in the for command (which means it's run directly on the command line and can't be run in a .bat file). So Brother lanlinlan can run it directly.
If you want to write it in a batch file, use double % signs ~ :)