'How to Replace text in the output from a Batch Script

I have a script I run and this is a sample output:

OK           J:        \\har-fs01\dept
OK           K:        \\erl-tbafs01.tbamerica.com\share 
OK           L:        \\erl-tbafs01\users\dfeist 
OK           N:        \\erl-tbafs01.tbamerica.com\scanneddata 
OK           S:        \\nov-fs02\share

I am trying to replace OK with Net Send and I am having no luck.

I have looked at other code and tried Google as well as here and all of the examples are close but even with modding, I cannot get anything to work.

(Sorry about the text. The webpage formatted it that way. They are seperate lines)



Solution 1:[1]

I was able to use this: for /f "tokens=*" %%a in (My.txt) do (echo Net Use %%a) >> c:\temp\output.txt

This replaced the text with what I needed and I got the requested results

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1