Find Replcae in text file

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Can anyone show me a good refined way to find and replace a portion of text
held in a text file held on a web server?

Thanks in Advance
 
Hi Paul,
My guess is you'd have to download the file, edit it locally, and then
upload the modified copy.

I'll help you with the part I know opening the local copy, replacing some
text, and saving the changes:

Dim strFile as string

strFile = "The File You Downloaded.htm"
FileOpen(1, strFile, OpenMode.Input, OpenAccess.Read, OpenShare.LockWrite)

FileSystem.Input(1, strDocument)

FileClose(1)

strDocument = Replace(strDocument, "Shit", "Sh..")

'Opens our document for output, with write only access, and locks the
writability until we're done

FileOpen(1, strFile, OpenMode.Output, OpenAccess.Write, OpenShare.LockWrite)

'Writes the strDocument text to the file

FileSystem.Write(1, strDocument)

'Closes our handle to the file, allowing all programs to edit the file

FileClose(1)

Cheers,
Christian
 
Paul,
Just some hints
Can anyone show me a good refined way to find and replace a portion of text
held in a text file held on a web server?
Make a VB.net asp.net application that:
- point the file on the webserver, gives the changes (from A, to B) one
by one or in a table in the webform page.
- open the file in your button event in your VB.net application
- change the file row by row
- tell that is is done, and ask for the next change or something.
Not such a big job I think using the VB.net language
I hope this helps
Cor
 
Back
Top