search and replace from .bat file ??

Discussion in 'Software' started by AliceWonder, Nov 22, 2012.

  1. AliceWonder

    AliceWonder Private E-2

    I started in the Macintosh world and moved to the Linux world.
    I run Windows 7 Pro on my laptop and it is first Windows release I actually like, MS did a good job. But I know next to nothing about Windows scripting.

    I'm looking for a Windows equivalent to sed on *nix systems. Basically what I am trying to do is from a batch file, the equivalent of

    Code:
    sed -e s/"^%\\\printdoctrue"/"\\\printdoctrue"/ < foo.tex > bar.tex
    
    Does anyone know how to do this from batch file in Windows 7 pro?

    What it does for those who don't know sed, it reads the file foo.tex and searches for the first occurrence of the string %\printdoctrue changing it to \printdoctrue in a file called bar.tex (creating it or overwriting it)

    Thanks for suggestions.
     
  2. GermanOne

    GermanOne Guest

    SED is available for Windows too. Even if it is not "on board" you'll find it in the internet.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds