你如何遍历使用Windows批处理文件的文本文件中的每一行? [英] How do you loop through each line in a text file using a windows batch file?

查看:117
本文介绍了你如何遍历使用Windows批处理文件的文本文件中的每一行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何通过使用Windows批处理文件和工艺在继承的每一行文本的文本文件中的每一行循环。

I would like to know how to loop through each line in a text file using a Windows batch file and process each line of text in succession.

推荐答案

下面帮助很大,但并没有做什么,我在我的问题说,我需要处理整行作为一个整体的帖子。以下是我找到工作。

The posts below helped greatly, but did not do what I stated in my question where I needed to process the entire line as a whole. Here is what I found to work.

for /F "tokens=*" %%A in (myfile.txt) do [process] %%A

有星号(*)记号关键字将拉动整条生产线的所有文本。如果你不把在星号只会牵上线的第一个字。我认为它有空间去做。

The tokens keyword with an asterisk (*) will pull all text for the entire line. If you don't put in the asterisk it will only pull the first word on the line. I assume it has to do with spaces.

对于命令TechNet上

我AP preciate所有的帖子!

I appreciate all of the posts!

这篇关于你如何遍历使用Windows批处理文件的文本文件中的每一行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆