Visual Basic - Ayuda VScript

Life is soft - evento anual de software empresarial
 
Vista:

Ayuda VScript

Publicado por eddy (1 intervención) el 21/03/2006 17:01:18
Hola tengo esto codigo y me gustaria pasarto a un archivo vbs, para podere ejecutarlo desde un arichibo

Dim NFileInput As Integer
Dim NFileOutput As Integer
Dim Linea As String

NFileInput = FreeFile
Open "MiArchivoInput" For Input As #NFileInput

NFileOutput = FreeFile
Open "MiArchivoOutput" For Output As #NFileOutput

Do Until EOF(NFileInput)
Line Input #NFileInput, Linea
If InStr(Linea, "%(TID:%):%IMAP4%") <> 0 Or InStr(Linea,
"%(TID:%):%LOGIN%") <> 0 Then
Print #NFileOutput, Linea
End If
Loop

Close #NFileInput, #NFileOutput
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Ayuda VScript

Publicado por Juan_K (181 intervenciones) el 23/03/2006 00:49:06
Algo asi

Dim fso
Dim NFileInput
Dim NFileOutput
Const ForReading = 1
Const ForWriting = 2
   
Set fso = CreateObject("Scripting.FileSystemObject")

Set NFileInput = fso.OpenTextFile("MiArchivoInput", ForReading)
Set NFileOutput = fso.OpenTextFile("MiArchivoOutput", ForWriting, True)

Do While NFileInput.AtEndOfStream <> True
    Linea = NFileInput.ReadLine
    If InStr(Linea, "%(TID:%):%IMAP4%") <> 0 Or InStr(Linea, "%(TID:%):%LOGIN%") <> 0 Then
       NFileOutput.WriteLine Linea
    End If
Loop
NFileInput.Close
NFileOutput.Close
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar