I am doing an activity that consists of the following: I have a list of data in plain text as follows:
and I want to compare the data after the second comma, if the data is a number I have to move it after the third comma, and if the data is a word in this case it is (Count 1 Pist.7) I will not do anything.
I am trying this but it does not work out, I would really appreciate your help. I'm doing it with VBA from Excel ...
Sub leerArchivoTexto()
'Leer archivos de texto separados por coma
'
Dim archivo As String 'ruta y nombre del archivo
Dim texto As String 'línea de texto a leer
Dim i As Integer
Dim n As Integer
Dim renglon As Integer
Dim columna As Integer
Dim contador As Integer
Dim texto2 As String
contador = 0
'Abrir el archivo
archivo = "C:\Users\Usuario\Desktop\Pistolas\conteo1Pistola7_mal.txt"
Open archivo For Input As #1
'Leer y procesar el contenido del archivo
While Not EOF(1)
Line Input #1, texto
texto2 = Trim(Mid(texto, 35, 6))
If (texto2 <> "Conteo") Then
contador = contador + 1
End If
Wend
MsgBox (contador)
Close #1
End Sub