Batch / Find And Edit Lines in TXT file

后端 未结 8 1563
陌清茗
陌清茗 2020-11-28 06:30

I want to create a batch while which finds specific lines in a batch file and are able to edit these lines.

Example:

//TXT FILE//

ex1
ex2
ex3         


        
相关标签:
8条回答
  • 2020-11-28 07:28

    This is the kind of stuff sed was made for (of course, you need sed on your system for that).

    sed 's/ex3/ex5/g' input.txt > output.txt

    You will either need a Unix system or a Windows Cygwin kind of platform for this.
    There is also GnuWin32 for sed. (GnuWin32 installation and usage).

    0 讨论(0)
  • 2020-11-28 07:33

    You can always use "FAR" = "Find and Replace". It's written under java, so it works where Java works (pretty much everywhere). Works with directories and subdirectories, searches and replaces within files, also can renames them. Also can rename bulk files.Licence = free, for both individuals or comapnies. Very fast and maintained by the developer. Find it here: http://findandreplace.sourceforge.net/

    Also you can use GrepWin. Works pretty much the same. You can find it here: http://tools.tortoisesvn.net/grepWin.html

    0 讨论(0)
提交回复
热议问题