0

So im trying to replace some text in a large .txt file.

Im using the open source tool "fart"

FART c:\test\test.txt c:\test\test_new.txt "->" ""

I want to remove all "->" in my text file. But when using the code i posted above, it seem like it dose not understand >. That symbol will just post all the options in fart.

is there a fast way to replace all "->" with nothing? it dose not have to be fart, it just have to be really fast.

Hope someone can help me out.

Compo
  • 36,585
  • 5
  • 27
  • 39
Daniel
  • 97
  • 1
  • 8
  • what does this have to do with powershell? – Lee_Dailey May 25 '20 at 08:26
  • If you want to use powershell and a script, use the the StreamReader library for big files. (https://www.sqlshack.com/reading-file-data-with-powershell/) There are tons of examples available in the web. If you want to have an exe, do it in c#. Fart is probably fine as well, but not too common to use afaik so you will not get any specific support for deeper questions – Farbkreis May 25 '20 at 09:27
  • I have voted to close your question, which is 'how do I use the [tag:command-line-interface] of [tag:fart]?'. This site is not for questions about software, and certainly not for those where you should be able to get the answer by reading the manual. I have removed your invalid [tag:batch-file], [tag:cmd], and [tag:powershell] tags, as none of those were relevant to your question. I woud further ask that you delete your off topic question. – Compo May 25 '20 at 09:55

1 Answers1

0

Use -- to tell FART that the options have ended and the only thing that follows are the search and replace strings.

fart c:\test\test.txt c:\test\test_new.txt -- "->" ""

Using -- this way is a convention that many command line tools, especially Linux/*nix, share.

Tomalak
  • 332,285
  • 67
  • 532
  • 628