"Steven"
> I am writing a script that needs to be
> able to search through a text
> file and search for the below string:
>
> "var INT_NMAX_BODY = 30"
>
> I want to change the value of this
> setting from 30 to 50 FYI
Another way is Microsoft's data parser
(with a built-in graph / chart maker that
uses the Microsoft ChartSpace objects)!
PS> $text = "Start of text file`n"
PS> $text += "var INT_NMAX_BODY = 30`n"
PS> $text += "End of text file."
PS> $text
Start of text file
var INT_NMAX_BODY = 30
End of text file.
PS> $newText = $text | LogParser.exe "SELECT
REPLACE_STR(Text,
'var INT_NMAX_BODY = 30',
'var INT_NMAX_BODY = 50') FROM
STDIN" -i:textline -headers

ff -stats

ff
PS> $newText
Start of text file
var INT_NMAX_BODY = 50
End of text file.
PS>
Sometimes a Log Parser one liner
at the command line will replace text
in many files without any script usage
at all too!
Yep Microsoft's Log Parser 2.2
is Microsoft's data parsing tool.