Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Temas - thexmachine

#1
Hola amigos,
Tengo el siguiente archivo de registro (log-web):

2017.04.24-16:52:42 <10.10.10.1>: web-proxy,debug logaccount:     GET http://www.msftncsi.com/ncsi.txt HTTP/1.1
2017.04.24-16:52:42 <10.10.10.1>: web-proxy,debug logaccount:     User-Agent: Microsoft NCSI
2017.04.24-16:52:42 <10.10.10.1>: web-proxy,debug logaccount:     Host: www.msftncsi.com
2017.04.24-16:52:42 <10.10.10.1>: web-proxy,debug logaccount:     X-Proxy-ID: 1806486836
2017.04.24-16:52:42 <10.10.10.1>: web-proxy,debug logaccount:     X-Forwarded-For: 192.168.13.221
2017.04.24-16:52:42 <10.10.10.1>: web-proxy,debug logaccount:     Via: 1.1 192.168.0.1 (Mikrotik HttpProxy)
2017.04.24-16:52:42 <10.10.10.1>: web-proxy,debug logaccount:


Debe ser configurado de forma txt (newlog.txt):
GET http://www.msftncsi.com/ncsi.txt
192.168.13.221
2017.04.24-16:52:42

Pero (newlog.txt):
GET http://www.msftncsi.com/ncsi.txt  192.168.13.221 2017.04.24-16:52:42

Traté de hacer algo
Código (bash) [Seleccionar]
  @Echo OFF & SetLocal EnableDelayedExpansion & Title by Elektro
   
    Set /A "flag=0"
   
    For /F "UseBackQ Tokens=* Delims=" %%a In (
        "C:\Documents and Settings\Unifi\Desktop\Syslog25042017.txt"
    ) Do (
        (Echo "%%a" >>teste5.txt | Find.exe /I "logaccount:     GET")1>Nul && (Set /A "flag=0")
        (Echo "%%a" >>teste5.txt | Find.exe /I "logaccount:     Host:")1>Nul && (Set /A "flag=1")
        (Echo "%%a" >>teste5.txt | Find.exe /I "logaccount:     X-Forwarded-For:")1>Nul && (Set /A "flag=2")
   
        If !flag! EQU 0 (Url: %%a)
        If !flag! EQU 1 (Host  : %%a)
        If !flag! EQU 2 (IP     : %%a)
   
    )
   
    Pause&Exit /B 0


¿Alguien me ayuda?
Gracias por todo  ;D
#2
Scripting / ayudar con lotes
8 Junio 2015, 20:17 PM
Hola, buenas tardes...
Necesito ayuda con un script...
Tengo 2 txts

SENHA.txt
12322111,0990
32322121,3994
62322191,5997
72322181,1998
formado por CPF y contraseña

Users.txt
Citar"array('12322111','0990',' 'fsdfsdfsdfsdfsdfsdfsdfsdfsdfsdf')
"array('32322121','3994',' 'rrtyrutytyutyututyutyututyutyut')
"array('62322191','3994',' 'sfrgthtyutyututyuyeefsdffgfgdg')
"array('72322181','0000',' 'cvxcvxcvxcvxcvxcvxcvxcvxcvx')

que tenga que buscar la CPF y contraseña en arquvio SENHA.txt
localizar el otro aquivo la CPF y si la contraseña es diferente que el par de torsión al mismo que el archivo SENHA.txt

Hice algo como esto:

Código (dos) [Seleccionar]
@echo off
set "fileA=Users.txt"
set "filmeB=Senhas.txt"
for /F "Tokens=1,* Delims=," %%a In ('Type "%fileA" ^| Sort') Do (
Call :InnerLoop
)

Pause&Exit /B 0

:InnerLoop
for /F "Tokens=1,* Delims=," %%a In ('Type "%fileB" ^| Sort') Do (
   If "%%~a" EQU "%%~A" (
   echo %%~a,%%~b,%%~B >> roda1.txt
   Exit /B 0 :: Break.
  )
)


Mod: los códigos deben ir en etiquetas GeSHi
#3
Scripting / Ayuda con FOR
12 Mayo 2015, 17:05 PM
Hola tengo una pregunta que alguien me ayude

Tengo un txt con a1.txt
1212,6777
1342,6767
3453,3456
3453,4743

Tengo otro con txt a2.txt
1342,BBBB
3453,DDDD
3453,CCCC
1212,AAAA

Quiero que buscan lotes 2 archivos y de impresión
result.txt
1212,6777,AAAA
1342,6767,BBBB
3453,3456,CCCC
3453,4743,DDDD

Vine a este, pero no funciona, alguien me ayude

FOR /F "tokens=1,2,3,4,5,6,7,8 delims=," %%A IN (A1.txt) DO  find /i "%%A" A2.TXT %%D,%%B,%%A >> result.txt