
Reemplazar espacios por guion
Publicado por antonio (1 intervención) el 23/12/2014 17:37:02
Hola, una duda, quiero reemplazar los espacios por guiones bajos a unos archivos, he echo el programa pero solo me cambia el primer archivo, creo que le falta un else para validar que en caso de que no tenga el espacio se pase al siguiente registro, no se como hacerlo, me ayudarian, diez puntos porfa!!!
Private Sub Command1_Click()
Dim PathArchivo As String
Open "D:\maxi\lista.txt" For Input As #1
Do While Not EOF(1)
Input #1, PathArchivo
FileCopy PathArchivo, Replace(PathArchivo, " ", "_")
Kill PathArchivo
Loop
Label1.Caption = PathArchivo
Label1.Refresh
Close #1
MsgBox "termine!!!"
End Sub
Private Sub Command1_Click()
Dim PathArchivo As String
Open "D:\maxi\lista.txt" For Input As #1
Do While Not EOF(1)
Input #1, PathArchivo
FileCopy PathArchivo, Replace(PathArchivo, " ", "_")
Kill PathArchivo
Loop
Label1.Caption = PathArchivo
Label1.Refresh
Close #1
MsgBox "termine!!!"
End Sub
Valora esta pregunta


0