hi all
i am right now examing one of the project thats avaliable.in which they have taken single log file as input. the code for it is given below.
the extensions that are specified here are log files extensions.... can i enhance this code to take in multiple log files as input...if i can then where should i edit the existing code to take multiple files..
can anyone guide me in this
awating a reply
thanks in advance for whatever help i get
thanks
sairaam
i am right now examing one of the project thats avaliable.in which they have taken single log file as input. the code for it is given below.
Code:
Private Sub cmdInputBrowse_Click() On Error GoTo ErrorLine Dim fname As String Dim fso As New FileSystemObject Dim ext, newext As Variant Dim stat, i As Integer stat = 0 If txtInputPath.Text <> "" Then If fso.FileExists(txtInputPath.Text) Then fname = Split(txtInputPath.Text, Mid(txtInputPath.Text, InStrRev(txtInputPath.Text, "\") + 1))(0) ElseIf fso.FolderExists(txtInputPath.Text) Then fname = txtInputPath.Text Else fname = Split(txtInputPath.Text, Mid(txtInputPath.Text, InStrRev(txtInputPath.Text, "\") + 1))(0) If InStr(1, txtInputPath.Text, ".") > 0 Then ext = "*." & Split(Mid(txtInputPath.Text, InStrRev(txtInputPath.Text, "\") + 1), ".")(1) Else ext = "*.csv" End If MsgBox ext stat = 1 End If If Not fso.FolderExists(fname) Then MsgBox "Folder specified does not exist", , "Input Log File" txtInputPath.Text = "" Exit Sub End If CDBrowseFile.InitDir = fname Else CDBrowseFile.InitDir = App.Path End If CDBrowseFile.Filter = "*.csv|*.csv;" & Chr(124) & "*.log|*.log;" & Chr(124) & "*.txt|*.txt" & Chr(124) & "*.*|*.*" CDBrowseFile.DialogTitle = "Select the Log File" If stat = 0 Then CDBrowseFile.FilterIndex = 1 Else If ext = "*.csv" Then CDBrowseFile.FilterIndex = 1 ElseIf ext = "*.log" Then CDBrowseFile.FilterIndex = 2 ElseIf ext = "*.txt" Then CDBrowseFile.FilterIndex = 3 Else CDBrowseFile.FilterIndex = 4 End If End If CDBrowseFile.ShowOpen If CDBrowseFile.FileName <> "" Then If fso.FileExists(CDBrowseFile.FileName) = True Then txtInputPath.Text = CDBrowseFile.FileName gstrInputFile = Mid(txtInputPath.Text, InStrRev(txtInputPath.Text, "\") + 1) CmdCompute.Enabled = True CDBrowseFile.FileName = "" Else MsgBox "File does not exist", vbCritical, "Input File" End If End If If txtInputPath.Text <> "" Then TxtOutputPath.Text = Mid(txtInputPath.Text, 1, InStrRev(txtInputPath.Text, "\") - 1) End If If TxtInputTimerFile.Text = "" Then TxtInputTimerFile.Text = Mid(txtInputPath.Text, 1, InStrRev(txtInputPath.Text, "\") - 1) & "\" End If Exit Sub ErrorLine: 'MsgBox "Error-Number:" & Err.Number & vbCrLf & "Error Description:" & Err.DESCRIPTION & vbCrLf & "Error At: Selecting input file" End Sub
can anyone guide me in this
awating a reply
thanks in advance for whatever help i get
thanks
sairaam
Comment