• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

automating a change in a header file

I have a bunch of instrumentation files (.par files) that I would like to load into another program. Unfortunately before this is possible they must first be opened in wordpad and a specific phrase in the header file must be changed (SPIP -> STM). Doing it manually is very easy because I just load it up and change it right in word pad. Is there a way to automate this process? It always occurs in the same location on the 4th line of the file. There are like 5,000 files though so doing it by hand would be laborious to say the least.
Thanks!
Stephen
 
I'd recommend a crash course in learning VBScript.

Start with the scripting.filesystemobject. If you've done any programming before, it shouldn't be too hard.
 
I wouldn't use vbscript. Perl is THE language for text manipulation. The only easier course would be bash with sed and awk 🙂

With perl (assuming they are all in one directory) I would read the directory listing into an array, then use that to loop through the array to open every file. Find the line with spip and change that line to stm. SHouldn't be too complex of a script tbh.
 
Back
Top