Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub BatchReplace()
Dim intFileIn As Integer, intFileOut As Integer
Dim strFileIn As String, strFileOut As String
Dim strLine As String
intFileIn = FreeFile
'Change the following line to match your actual
'directoty
strFileIn = Dir("C:\*.csv")
intFileOut = FreeFile
Do
'Open the original file
Open strFileIn For Input As #intFileIn
'Create the name and open the output file
strFileOut = strFileIn & ".tmp"
Open strFileOut For Output As #intFileOut
Do
'Read a line from the input file
Line Input #intFileIn, strLine
'Do the replacement
strLine = Replace(strLine, "[Null]", "")
'Write the new line to the output file
Print #intFileOut, strLine
Loop Until EOF(intFileIn)
'Close int input file and delete
Close #intFileIn
Kill strFileIn
'Close the output file
Close #intFileOut
'Copy the new file to the old file name
FileCopy strFileOut, strFileIn
'Delete the temp file
Kill strFileOut
'Check to see if there is another file to convert
strFileIn = Dir
Loop Until strFileIn = ""
End Sub
Sub BatchReplace()
Dim intFileIn As Integer, intFileOut As Integer
Dim strFileIn As String, strFileOut As String
[b]Dim strPath As String[/b]
Dim strLine As String
[b][green]'Change the following line to match your actual
'directoty[/green][/b]
[b]strPath = "C:\"[/b]
intFileIn = FreeFile
strFileIn = Dir([b]strPath & [/b]"*.csv")
[s][red]intFileOut = FreeFile[/red][/s]
Do
'Open the original file
Open [b]strPath &[/b] strFileIn For Input As #intFileIn
'Create the name and open the output file
strFileOut = strFileIn & ".tmp"
[b]intFileOut = FreeFile[/b]
Open [b]strPath &[/b] strFileOut For Output As #intFileOut
...