Click to See Complete Forum and Search --> : editing the following text file


winsonlee
July 26th, 2003, 03:32 PM
the following code is kept in a text file. I would like to know how i can edit the following information ?? lets say under prompt, I would like to edit from


prompt = text("PC requirement ? "),

to


prompt = text("Server requirement ? "),

How can I archieve this ???


% question

:- indexed question(1,0,0).

question(R1, /, [
prompt = text("PC requirement ? "),
question_type = menu_single_choice,
question_style = listbox,
choices = ["Software", "Hardware"],
'rule-display_choices' = [["rule_text", "display_text"]],
answer_type = text,
length = 20,
height = 1,
default = "",
ask_also = '[]'
]).

question(R2, /, [
prompt = text("supported user?"),
question_type = menu_single_choice,
question_style = listbox,
choices = ["20 users", "40 users", "60 users"],
'rule-display_choices' = [["rule_text", "display_text"]],
answer_type = text,
length = 20,
height = 1,
default = "",
ask_also = '[]'
]).



The following attachment is a sample of the file that i am trying to edit.

coolbiz
July 28th, 2003, 11:58 PM
Simplest (might not be the most optimized) way is to read the whole file content into a StringBuilder. Then use the .Replace() method to replace the wording. After that, you can dump the content of the stringbuilder back into the file.

-Cool Bizs