Batch-replacing Text In Code Files?

Discussion in 'Software' started by HarryPotter, Apr 28, 2021.

  1. HarryPotter

    HarryPotter MajorGeek

    Hi! I want to port some code from one system to another, and this involves renaming some variables. Namely, I want to replace the string "bank1_" to "aux_" in all the .C and .S files in one folder. Is there an easy way to do this?
     
  2. harmless

    harmless Staff Sergeant

    back in the day, when i had personal websites, replacing text in html files was a pain until i found a program called, something like win grep auto replace. this was like 15 to 20 years ago. i tried a bunch of these small utilities, and this was the only one that did not alter the original file in an undesirable way... like adding in extra blank lines or spaces. it is a stand alone program, nothing to install. i still use it because it works just fine on my mac pro using codeweavers crossover. i just put it up on the glorious interwebs, along with a few other oldies but goodies, like ckrename, for batch renaming of files. anyway, you can get it here : http://www.hallsted.ws/downloads/index.htm
    good luck with it all.
     
  3. HarryPotter

    HarryPotter MajorGeek

    I downloaded the file, but it only contained a folder and three images. :(
     
  4. Eldon

    Eldon Major Geek Extraordinaire

  5. HarryPotter

    HarryPotter MajorGeek

    I downloaded it. Thank you!
     
  6. HarryPotter

    HarryPotter MajorGeek

    It made my life easier. Thanks, again! :)
     
  7. harmless

    harmless Staff Sergeant

    i need to get a new webhost.
    there were 14 older, small programs on that page, all zipped up. grand total of like 5MB.
    i downloaded and looked at all of them, and the exe file was gone in about half of them.
    both eset nod and malwarebytes found nothing in those original files on my computer.
    but my webhost just deleted the exe's inside of the zipped files, for some reason.
    anyway, sorry about that, glad you found something that worked.
    [[ and i deleted that web page since it is basically worthless, sigh ]]
     

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