pantho Posted September 2, 2009 Report Share Posted September 2, 2009 I am wanting to edit text files, but I want to edit alot of files, and alot of strings in those files. So I come back to my old love Macro Express... Sadly I never really used it for much more than mouse clicks/text input. So, an example of what I want to edit: <subtitle_script id='47166' title='English' play_res_x='640' play_res_y='480' lang_code='enUS' lang_string='English (US)' created='2 days ago' progress_string='' status_string='Approved' wrap_style='2'><styles><style id="49922" name="PLACEHOLDERS" <subtitle_script id='47166' I want to replace with: [script Info]^p <style id="49922" name=" I want to replace with: Style: 1st Problems: For some reason, even trying to simply replace the word "play" with "apple" is not working, It is loading the file into T5 and then from there it is saving it to sample2.txt as it is supposed to :/ 2nd Problem: How do I make wildcards as the ID 47166 is a random number depending which file I want to replace (plan to run macro on 50+ files to start with) <VSETMISC:T4:Installation Path><REM2:use text file in installationPath "textanswers.txt"><TVAR2:05:04:C:\Program Files\Macro Express3\sample.txt><REM2:Do all your replaces here; this only example><TMVAR2:21:05:01:001:000:nameapple><DELAY:1><REM2:....all numbers, descending, in between; there's probably a better way...><TMVAR2:17:05:00:000:000:C:\Users\Pantho\Documents\sample2.txtT> Set Variable %T4% to "Installation Path" // use text file in installationPath "textanswers.txt" Variable Set String %T5% from File: "sample.txt" // Do all your replaces here; this only example Replace "name" with "apple" in %T5% Delay 1 Seconds // ....all numbers, descending, in between; there's probably a better way... Variable Modify String: Save %T5% to Text File This is what I have found so far, from reading related topics. Any help you can with the first 2 search and replace commands would be great, then I could use those examples to finish the rest. Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.