help in creating a batch file please

Discussion in 'Software' started by toki5, Oct 27, 2015.

  1. toki5

    toki5 Private First Class

    I want to create a batch file that will help me delete certain words or symbols within certain files. So like I would like for it to delete like (U) within a file with gbx extension. All of these are in one folder. I hope this makes sense as I would like to batch delete these within the one folder.
     
  2. DOA

    DOA MG's Loki

  3. foogoo

    foogoo Major "foogoo" Geek

  4. AtlBo

    AtlBo Major Geek Extraordinaire

    toki...

    Don't know if this will help...

    I use a batch to do what you would like, but it points to a specific file rather than a folder. It's actually two batch files. The first one activates the second one, which is sort of a generic do all editing (text replace) batch called REPL.bat.

    The initiator batch I have someone at SourceForge helped me put together to change the text in a program .ini file for one particular line. One setting in that .ini reverts to a default every so often. Running the file, which starts REPL.bat, automatically changes the setting back when the SourceForge .bat is run. I run it on a schedule to make sure the setting is as intended in the target .ini.

    I recommend trying SourceForge if you can't find help here. REPL.bat I can pass on to you if you like (and the other .bat so you can see how it refers to REPL.bat). Then you could have someone help you create a batch that would use REPL.bat as you intend it to be used. You would definitely need at least two major loops in your batch file. One would be to cycle through all the files with the .gbx extension, and then another to cycle through all the lines within each .gbx file.

    Just to be clear...REPL.bat isn't to be edited. You simply leave the code in REPL.bat as it is to execute changes to a file(s) as you intend. Your batch would be telling it what to look for filewise and then within the file. It also tells it what to change and what to change it to. Inside REPL.bat there is a fairly good explanation of what you can set it to do (in this case by using a separate batch)...
     
  5. toki5

    toki5 Private First Class

    I appreciate the responses. What I have done so far is use the search function to just delete everything it brings up. It doesn't find all of them, but it has found most of what I was trying to delete in a more batch method.
     
  6. foogoo

    foogoo Major "foogoo" Geek

    Download Notepad ++ from https://notepad-plus-plus.org/
    Open it, then go to Search, then Find In Files
    In the popup Find What: (U), leave replace blank, select sub folders if needed, select the directory, Filters: *.gbx click Replace in Files.

    This will edit every file with the gbx extension replacing (U) with nothing in the designated folder or folders of you select subfolders option.

    No need to reinvent the wheel...:-o

    I thought you meant file names - some filenames have a (U) for universal.
     
    Last edited: Oct 29, 2015

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