Guest User

Untitled

a guest
Oct 16th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. Sub leerArchivoTexto()
  2. 'Leer archivos de texto separados por coma
  3. '
  4. Dim archivo As String 'ruta y nombre del archivo
  5. Dim texto As String 'lĂ­nea de texto a leer
  6.  
  7.  
  8. Dim i As Integer
  9. Dim n As Integer
  10. Dim renglon As Integer
  11. Dim columna As Integer
  12. Dim contador As Integer
  13. Dim texto2 As String
  14.  
  15.  
  16. contador = 0
  17. 'Abrir el archivo
  18. archivo = "C:UsersUsuarioDesktopPistolasconteo1Pistola7_mal.txt"
  19. Open archivo For Input As #1
  20.  
  21. 'Leer y procesar el contenido del archivo
  22. While Not EOF(1)
  23. Line Input #1, texto
  24.  
  25. texto2 = Trim(Mid(texto, 35, 6))
  26.  
  27.  
  28. If (texto2 <> "Conteo") Then
  29. contador = contador + 1
  30. End If
  31.  
  32.  
  33.  
  34. Wend
  35. MsgBox (contador)
  36.  
  37. Close #1
  38.  
  39. End Sub
Add Comment
Please, Sign In to add comment