1,485
社区成员
发帖
与我相关
我的任务
分享
Option Explicit
Private Sub Command1_Click()
Dim FileName As String
Dim FilePath As String
FilePath = "F:\fvf\"
FileName = Dir(FilePath & "*.txt")
While Len(FileName) <> 0
If Mid(FileName, 1, 1) = "z" And Mid(FileName, 3) = "Printdata.txt" Then '此得可以自己设定条件
Name FilePath & FileName As FilePath & Mid(FileName, 1, 1) & Format(Mid(FileName, 2, 1), "00") & Mid(FileName, 3)
End If
If Mid(FileName, 1, 14) = "1-printhighf-Z" And Mid(FileName, 16) = ".txt" Then
Name FilePath & FileName As FilePath & Mid(FileName, 1, 14) & Format(Mid(FileName, 15, 1), "00") & Mid(FileName, 16)
End If
FileName = Dir
Wend
End Sub
Option Explicit
Private Sub Command1_Click()
Dim FileName As String
Dim FilePath As String
FilePath = "F:\fvf\"
FileName = Dir(FilePath & "*.txt")
While Len(FileName) <> 0
If IsNumeric(Mid(FileName, 1, 1)) And Not IsNumeric(Left(Right(FileName, 6), 2)) Then '此得可以自己设定条件
Name FilePath & FileName As FilePath & Mid(FileName, 1, 1) & Format(Mid(FileName, 2, 1), "00") & Mid(FileName, 3)
End If
If Not IsNumeric(Mid(FileName, 1, 1)) And Not IsNumeric(Mid(FileName, 2, 2)) Then
Name FilePath & FileName As FilePath & Mid(FileName, 1, 14) & Format(Mid(FileName, 15, 1), "00") & Mid(FileName, 16)
End If
FileName = Dir
Wend
End Sub
Option Explicit
Private Sub Command1_Click()
Dim FileName As String
Dim FilePath As String
FilePath = "F:\fvf\"
FileName = Dir(FilePath & "*.txt")
While Len(FileName) <> 0
If not isnumeric(Mid(FileName, 1, 1)) Then '此得可以自己设定条件
Name FilePath & FileName As FilePath & Mid(FileName, 1, 1) & Format(Mid(FileName, 2, 1), "00") & Mid(FileName, 3)
Else
Name FilePath & FileName As FilePath & Mid(FileName, 1, 14) & Format(Mid(FileName, 15, 1), "00") & Mid(FileName, 16)
End If
FileName = Dir
Wend
End Sub