Novell is now a part of Micro Focus

Changing Text Files

Novell Cool Solutions: Tip
By David Mitchell

Digg This - Slashdot This

Posted: 22 Dec 1999

Alert reader David Mitchell had a much cooler solution than ours, and we stand happily corrected. This is why we love the Cool Solutions Community. Together, we get it right.

You answered one of the Q&A as follows:

Chris B. wrote: I'm trying to alter a config.sys string (FILES=90). The problem I'm having is that the amount of files can be different from PC to PC and I would like to use "Wildcard" variables to say delete the value in FILES=90 and replace it with a set value. Are there wildcard values or variables I can use? Or is there a better way of doing this?

Sorry to say, Chris, you're in for some grunt work. There are no "wildcard" variables in changing text files. The best we can think of is listing all the possible "FILES=20, FILES=30, FILES=40" in a brute force method. Maybe adding a new "FILES=90" line at the bottom of the config.sys will override the first entry. This is one of those times when you should hire, gulp, an intern.

A Better Way
Your recomendation to hire an intern seems a little expensive. I feel that I have a better solution to this issue. If you do a search and replace on the string FILES=, you could then replace it with REM FILES=. After doing that, you could add the line with the setting that you actually want to have.

This also works in other instances. In Windows INI files, you replace the first portion of the string with a semicolon. We had to do this making a change to a Netscape prefs.js file. In order to remark out the line we used a double front slash (//). Hope this helps.

Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions.

© Copyright Micro Focus or one of its affiliates