Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Edit Text File, Pls. HELP !!!

Status
Not open for further replies.

coolphilboy

Technical User
Aug 19, 2001
19
0
0
PH
I have a text file named FILE1.TXT which contains ascii characters like below:

AAABBBCCC**DD
GTDF**NfDg*VC
ERvC*VcfD***T

I want to edit this file and replace the "*" characters
to white space " " and save and close the file. How will i
do this in VB. Please help!!!

TIA
John
 
I presume it is a sequential file. You will have to read the file fully in INPUT mode, change the text and then write it fully in output mode. PK Odendaal
pko@942.co.za

 
To do the replace:

myString = Replace(myString,"*"," ") Let me know if this helps
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Open InFileName For Binary As #1
Open ReportFile For Output As #2
InputData = String$(RecordSize, 32)
NumOfRecords = LOF(1) \ RecordSize
Counter = 0

Do
Counter = Counter + 1
InputData = Replace(InputData,"*"," ")
Loop Until Counter = NumOfRecords Swi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top