创建一个批处理文件,该批处理文件读取一个.txt文件并将所需的行输出到另一个.txt文件中 [英] to create a batch file which reads a .txt file and outputs the required lines onto another .txt file

查看:74
本文介绍了创建一个批处理文件,该批处理文件读取一个.txt文件并将所需的行输出到另一个.txt文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个输入文本文件,每行有一个单词(打个招呼&打个招呼)和休止符.我需要读取整个文件,并使用批处理文件仅将带有hi(而不是hello)的行输出到另一个文本文件中.

I am having an input text file with a word(say hi & hello ) and rest numbers in every line . I need to read the entire file and output only the lines with hi (not hello) onto another text file using a batch file.

推荐答案

find /i "hi " "text_file.txt">file2.txt

c heck FIND和FINDSTR命令.

这篇关于创建一个批处理文件,该批处理文件读取一个.txt文件并将所需的行输出到另一个.txt文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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