editing the following text file

darkznet

New member
Joined
Jul 25, 2003
Messages
4
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

Code:
prompt = text("PC requirement ? "),

to

Code:
prompt = text("Server requirement ? "),

How can I archieve this ???

Code:
% 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 = [] 
]).
 
You can read each line of the file with a StreamReader, check if it StartsWith "prompt", then do whatever to the String (use its Replace method to replace "PC" with "Server"), and then write it to the file with a StreamWriter.
 
Back
Top