0

I need to replace a string in a file A, with empty string. And I need to do it using Batch script.

Input: A.txt A.txt contains "xyz", which I need to replace with empty string in same file A.txt.

I need to replace only "xyz" from the file A.txt, not the entire file. The file A.txt contains contains several other strings.

Please let me know if possible.

3

1 Answer 1

1

This will replace the xyz with nothing, which is effectively an empty string.

echo.>a.txt 
Sign up to request clarification or add additional context in comments.

2 Comments

I believe the OP wants to replace only "xyz" with an empty string, not the entire file content. But the question is a bit unclear.
@dbenham The OP hasn't replied so anything could be the case. :) I took the question at face value and he didn't mention anything else in the file.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.