Hi,
I am using some code (below) to try to delete quotation marks in a file (txt). But i can't figure out how to delete the quotation mark (only one at a time - ")
Does anyone know how to do this. Your help is much appreciated!
Thanks!
Rob
Public Sub AASDBCleanTxtFile()
Dim dbs As Database
Dim rec As Recordset
Dim strSQL As String, strSQL2 As String, strSQL3 As String
Dim sql As String
Dim count As Integer
Dim NAME As String, PRICE As Double, Weight As Double, Cost As Double, TAX As Double
Dim SUBTOTAL As Double, TOTAL As Double
Dim fso As FileSystemObject
Dim tsMyFile As TextStream
Dim Trimmed As String
Dim strText As String
Dim ff As Integer
' Dim RegExp As Object
Set dbs = CurrentDb()
ff = FreeFile
PUBTxtFile = "C:\AAS\DB\Miva\ImportToWeb\MivaProductUpdateTXT1.txt"
' Set re = CreateObject("VBScript.RegExp")
' Set re = New RegExp
Set fso = New FileSystemObject
Set tsMyFile = fs
penTextFile(PUBTxtFile, ForReading)
Do Until tsMyFile.AtEndOfStream
strText = Replace(tsMyFile.ReadLine, Chr(10), vbCrLf)
strText = Replace(strText, "''", "")
If strText <> "" Then
Open "C:\AAS\DB\Miva\ImportToWeb\MivaProductUpdateTXT1_NEW.txt" For Output As #ff
Print #ff, strText
Close #ff
End If
DoEvents
Loop
Set re = Nothing
Set fso = Nothing
Set dbs = Nothing
End Sub
I am using some code (below) to try to delete quotation marks in a file (txt). But i can't figure out how to delete the quotation mark (only one at a time - ")
Does anyone know how to do this. Your help is much appreciated!
Thanks!
Rob
Public Sub AASDBCleanTxtFile()
Dim dbs As Database
Dim rec As Recordset
Dim strSQL As String, strSQL2 As String, strSQL3 As String
Dim sql As String
Dim count As Integer
Dim NAME As String, PRICE As Double, Weight As Double, Cost As Double, TAX As Double
Dim SUBTOTAL As Double, TOTAL As Double
Dim fso As FileSystemObject
Dim tsMyFile As TextStream
Dim Trimmed As String
Dim strText As String
Dim ff As Integer
' Dim RegExp As Object
Set dbs = CurrentDb()
ff = FreeFile
PUBTxtFile = "C:\AAS\DB\Miva\ImportToWeb\MivaProductUpdateTXT1.txt"
' Set re = CreateObject("VBScript.RegExp")
' Set re = New RegExp
Set fso = New FileSystemObject
Set tsMyFile = fs
Do Until tsMyFile.AtEndOfStream
strText = Replace(tsMyFile.ReadLine, Chr(10), vbCrLf)
strText = Replace(strText, "''", "")
If strText <> "" Then
Open "C:\AAS\DB\Miva\ImportToWeb\MivaProductUpdateTXT1_NEW.txt" For Output As #ff
Print #ff, strText
Close #ff
End If
DoEvents
Loop
Set re = Nothing
Set fso = Nothing
Set dbs = Nothing
End Sub