Batch executable to find replace text?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: Batch executable to find replace text?

#16 Post by abc0502 » 11 Oct 2012 19:14

foxidrive wrote:I still can't get it to work with a spaceTAB or TABspace - it creates a zero byte 1.txt file.


1.txt

1,2,3Bob Jones
2,3,4Mary
3,4,5Tom Riley


replace.txt

Bob Jones:Fred Thomas
Mary:Jane
Tom Riley:Doug Smith

It work with me here except these all empty lines at the end, but i think the problem here is that
"3Bob Jones" is not "Bob Jones" there is no space between the "3" and "Bob" so it will be a whole different word

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Batch executable to find replace text?

#17 Post by foxidrive » 11 Oct 2012 19:37

I put spaces before the search terms

1,2,3 Bob Jones
2,3,4 Mary
3,4,5 Tom Riley


Same thing, zero byte file. Are you using Win7 or XP maybe?

EDIT: it does the same in XP too.

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: Batch executable to find replace text?

#18 Post by abc0502 » 11 Oct 2012 19:47

I use windows XP, i have no idea now what is going ?!
this thing happend with me before with the wmi fix batch , when was created it was working fine after while i tried to test it again and it didn't work. :!:

any way your code works fine and replace text, and i guess my code need to be re-written from scratch :shock:

Post Reply