You can use the Replace function to change just the first occurence of "."
to "_":
ModifiedName = Replace(OriginalFileName, ".", "_", 1, 1, 1)
To rename all .csv files in a folder, this code snippet should work:
Dim strFileOrig As String, strPathName As String, strFileNew As String
strPathName = "YourPathString\"
strFileOrig = Dir(strPathName & "*.csv")
Do While strFileOrig <> ""
strFileNew = Replace(strPathName & strFileOrig, ".", "_", 1, 1, 1)
Name strPathName & strFileOrig As strPathName & strFileNew
strFileOrig = Dir()
Loop
--
Ken Snell
<MS ACCESS MVP>
"cherman" <(E-Mail Removed)> wrote in message
news

735B943-FBC9-4F86-867C-(E-Mail Removed)...
>I need to replace the 1st "." in
> "(E-Mail Removed)" with "_". Or I need to
> remove
> it completely. This is a filename that I need to import, but this period
> is
> causing the import to error out.
>
> Actually I am writing a proc that will cycle through the .csv files in a
> folder and I need to make the above replacement for all .csv files that
> start
> with "PartnerContract". Below is the code I have so far. Any suggestions
> as
> to how I can complete this would be greatly appreciated.
>
> 'Set file type.
>
> strFile = Dir$(PathName & "*.csv*")
>
> 'Check if any .csv files are in Imports directory.
>
> If Len(strFile) > 0 = False Then
> MsgBox "There are no update files.", vbOKOnly, "WARNING"
> Exit Sub
> End If
>
> 'Import all .csv files in Imports directory.
>
> Do While Len(strFile) > 0
>
> If Left(strFile, 15) = "PartnerContract" Then
>
> strFile = Dir$()
>
> End If
>
> Loop