蝙蝠脚本,用什么来delim中读取一行文本文件中的行 [英] bat script, what delim to use to to read text file line by line

查看:121
本文介绍了蝙蝠脚本,用什么来delim中读取一行文本文件中的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含以下行的TXT文件

  jfo3 93jfl
lvls 29fdj
nskd jfuwe
xlkw eklwe

我想逐行读出,并用它做什么。我应该使用什么分隔符。我在这里使用的DELIM分别读取每个字。

 关闭@echo
SETLOCAL EnableDelayedExpansion
FOR / Fdelims =%%倍In(lines.txt)做(
    回声%%点¯x


解决方案

这读取一行一行对我来​​说:

  FOR / Fdelims =%在(lines.txt)x做回声%×

I have a txt file that contains the following lines

jfo3 93jfl
lvls 29fdj
nskd jfuwe
xlkw eklwe

I'm trying to read line by line, and do something with it.. What delimiter should I use. The delim I'm using here reads each word separately.

@echo off
setlocal EnableDelayedExpansion
for /f "delims=" %%x in (lines.txt) do (
    echo %%x
)

解决方案

This reads line by line for me:

for /f "delims=" %x in (lines.txt) do echo %x

这篇关于蝙蝠脚本,用什么来delim中读取一行文本文件中的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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