Well, to answer one question, I found replace in the System.Text.RegularExpressions.Regex class.
I have the Visual Studio.NET, so that's lucky for me, but I think you would bneed to concentrate on using MSDN.Microsoft.com for your reference needs. Also, I am not familiar with JBuilder, but I would think that you would be better off with an ASP.NET IDE. There is a free one at asp.net that looks just like Visual Studio although it lacks features like the documentation for classes and such. However, it still appears to be very powerful although I have not used it myself. I have never worked with .NET as far as files go so I'm taking a astab in the dark at this, but let me try to help you out knowing what I know about file processing: How big are the files you're working with? If they aren't too big (I imagine 32K is kind of small) then you could probably read both entire files into string variables and then use a regular expression or a replace function to replace the string you're looking for. Then just write your new string. If you're thinking that the file is large (I'd say that 1-2 Megs are big, but I could be wrong) , then you might be better off reading a block of text into a string variable, then use the same method as above, but write the changed text back to a file after it's replaced. The less reads you have, the quicker this will be. Batch the process so you achieve the quickest, most correct results. Matthew Small IT Supervisor Showstopper National Dance Competitions 3660 Old Kings Hwy Murrells Inlet, SC 29576 843-357-1847 http://www.showstopperonline.com -----Original Message----- From: Falls, Travis D (CASD, IT) [mailto:[EMAIL PROTECTED]] Sent: Monday, September 09, 2002 11:54 AM To: ActiveServerPages Subject: RE: ASP.NET Well, for one I am having a hard time finding where to look fro documentation on the classes and methods. I know VB has a relpace() function, but I don't know what class has it. I can't seem to figure out how to use VS.net, and I am so use to using JBuilder, and I use the "." operators to show me the methods. so I guess I am having trouble finding out how to learn the api. Any thoughts matt? Regards, Travis D. Falls -----Original Message----- From: Matthew Small [mailto:[EMAIL PROTECTED]] Sent: Monday, September 09, 2002 11:42 AM To: ActiveServerPages Subject: RE: ASP.NET What kinds of problems are you having? Matthew Small IT Supervisor Showstopper National Dance Competitions 3660 Old Kings Hwy Murrells Inlet, SC 29576 843-357-1847 http://www.showstopperonline.com -----Original Message----- From: Falls, Travis D (CASD, IT) [mailto:[EMAIL PROTECTED]] Sent: Sunday, September 08, 2002 8:25 PM To: ActiveServerPages Subject: ASP.NET does anyone know what the most efficient way to read in a file, search it and then replace a key word with the contents of another file? I want to create a wrapper, read it in search it for ~~REPLACE THIS~~ when I find it replace it with the contents from another file. here is my code so far but I am stuck and haven't found much on the web. <%@ Import Namespace="System.IO" %> <script language="vb" runat="server"> sub Page_Load(sender as Object, e as EventArgs) Dim FILENAME as String = Server.MapPath("../template20020826.htm") Dim objStreamReader as StreamReader Dim contents as String Dim tester as boolean tester = true objStreamReader = File.OpenText(FILENAME) Do While tester = true contents= objStreamReader.ReadLine() if(contents = "~~Replace This~~") Then Dim FILENAME2 as String = Server.MapPath("../travis.htm") Dim objStreamReader2 as StreamReader objStreamReader2 = File.OpenText(FILENAME2) Dim innerContents as String = objStreamReader2.ReadToEnd() contents = contents & innerContents end if if (contents = "") Then Exit Do Loop Output.Text = contents objStreamReader.Close() end sub </script> <asp:label runat="server" id="Output" /> This communication, including attachments, is for the exclusive use of addressee and may contain proprietary, confidential or privileged information. If you are not the intended recipient, any use, copying, disclosure, dissemination or distribution is strictly prohibited. If you are not the intended recipient, please notify the sender immediately by return email and delete this communication and destroy all copies. --- You are currently subscribed to activeserverpages as: [EMAIL PROTECTED] To unsubscribe send a blank email to %%email.unsub%% --- You are currently subscribed to activeserverpages as: [EMAIL PROTECTED] To unsubscribe send a blank email to %%email.unsub%% --- You are currently subscribed to activeserverpages as: [EMAIL PROTECTED] To unsubscribe send a blank email to %%email.unsub%% --- You are currently subscribed to activeserverpages as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED]
