Object Stream1
String filename, text
Number fileID, streamsize
If (!OpenDialog(NULL, "Replace one by another", GetApplicationDirectory(2,0) + "xyz.txt", filename)) Exit(0)
fileID = OpenFileForReadingAndWriting(filename)
Stream1 = NewStreamFromFileReference(fileID, 1)
streamsize = Stream1.StreamGetSize()
While( Stream1.StreamGetPos() < streamsize )
{
text = Stream1.StreamReadAsText(0, 1)
/* The IF commands below uses single capital-case 
letter to replace single low-case letter in the '.txt' file. 
This replacement can also be done with single symbols such as '.', ','. */
If (text == "H")
{
Stream1.StreamSetPos(1, -1)
Stream1.StreamWriteAsText(0, "h")
}
}
CloseFile(fileID)