|
-
May 23rd, 2001, 04:39 AM
#1
Txt file
I need to remove tripple commas and qotes, (,,, ")
this is what i have so far.........
Public Function SearchRep(strsour As String, strtarg As String, search As String, rep As String, yvar As Integer) As String
Dim MyString As String
Dim Newstring As String
Dim Oneletter As String
Dim Trip As String
Dim x As Integer
Dim y As Integer
Dim z As Integer
Dim supernewstring As String
Dim strSearch As String
Dim strRep As String
Dim convertedname As String
Dim ssourcefile As String
Dim old As Integer
strSearch = search
strRep = rep
convertedname = strtarg
ssourcefile = strsour
y = yvar
old = y
If convertedname <> "" Then
Screen.MousePointer = vbHourglass
Open convertedname For Output As #2
Open ssourcefile For Input As #1 ' Open file.
Do While Not EOF(1) ' Loop until End of file.
Input #1, Newstring ' Read data into one variable.
z = z + 1
For x = y To Len(Newstring)
Trip = ""
y = y - 2
'x = x - 2
For z = 1 To 3
Trip = Trip & Mid(Newstring, y, 1)
y = y + 1
Next z
'z = 0
Select Case (Trip)
Case strSearch: Trip = strRep
Newstring = Newstring & Trip
End Select
Next x
Print #2, Newstring
Newstring = ""
DoEvents ' it is important To unlock the screen
Loop
Close #1 ' Close file.
Close #2
Screen.MousePointer = vbDefault
'Else
'MsgBox " Destination File Read Erorr.. "
End If
End Function
can anyone help..........?
thanx
-DAVE
-
May 23rd, 2001, 04:44 AM
#2
Re: Txt file
check the vb function call Replace. it might help.
cksiow
http://vblib.virtualave.net - share our codes
-
May 23rd, 2001, 04:46 AM
#3
Re: Txt file
If you are using VB6 just use the replace function
Mystring="Hello,,,"
Mystring=Replace(Mystring,",,,","")
'Will give you "Hello"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|