kukris Posted September 1, 2006 Share Posted September 1, 2006 Hi,I want to replace an expression in a file with another expression on a command line.Exampleprog.exe <string1> <string2> <filename>Does anyone know such a tool? Link to comment Share on other sites More sharing options...
Bark Posted September 1, 2006 Share Posted September 1, 2006 In the UNIX world they would use a utility named "sed". Here's a port: http://gnuwin32.sourceforge.net/packages/sed.htm. It's not the easiest thing in the world to use, but it's not that hard either once you get the hang of it. Link to comment Share on other sites More sharing options...
Ctrl-X Posted September 2, 2006 Share Posted September 2, 2006 I like GSAR better... Personally I think it's easier to use. Link to comment Share on other sites More sharing options...
kukris Posted September 2, 2006 Author Share Posted September 2, 2006 Thanks,Gsar looks more easy, but I couldn't get it to work with search strings with a comma, but that is what I need.It doesn't work for a string containing a comma and text, like 0,win. I tried to put it in quotes, but no luck.Then I replaced it with ASCII or Hex-Code it just displays one match, but there are much more.Does anybody know a solution for that or another tool? Link to comment Share on other sites More sharing options...
At0mic Posted September 2, 2006 Share Posted September 2, 2006 Yes use Munge.exe. Its part of the NT4 Resource Kit. You can search for it using google, I used it a few days ago for a batch file and it works very well.Just create a txt file containing the current string and the required string separated by a space. You can sounded the string with " " as it works with any quoted text so your expression should work.MUNGE strings.txt -l -t file.txtstrings.txt contains your search strings and file.txt is the file you want to edit Link to comment Share on other sites More sharing options...
kukris Posted September 3, 2006 Author Share Posted September 3, 2006 Thanks At0mic,that's the most easiest and Windows-like tool. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now