|
Mostrar Mensajes
|
Páginas: [1]
|
1
|
Programación / Scripting / [BAT] Generar txt registro simplificado
|
en: 25 Abril 2017, 19:52 pm
|
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.txt192.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 @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 
|
|
|
2
|
Programación / Scripting / ayudar con lotes
|
en: 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 "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: for /F "Tokens=1,* Delims=," %%a In ('Type " %fileA" ^| Sort' ) Do ( ) :InnerLoop for /F "Tokens=1,* Delims=," %%a In ('Type " %fileB" ^| Sort' ) Do ( echo %%~a, %%~b, %%~B >> roda1.txt ) )
Mod: los códigos deben ir en etiquetas GeSHi
|
|
|
3
|
Programación / Scripting / Re: Ayuda con FOR
|
en: 12 Mayo 2015, 17:38 pm
|
lo siento, pero no duplica los datos cometido un error de mecanografía
Tengo un txt con a1.txt 1212,6777 1342,6767 3453,3456 3451,4743
Tengo otro con txt a2.txt 1342,BBBB 3453,DDDD 3451,CCCC 1212,AAAA
Quiero que buscan lotes 2 archivos y de impresión result.txt 1212,6777,AAAA 1342,6767,BBBB 3453,3456,DDDD 3451,4743,CCCC
muchas gracias Te debo una cerveza
[MOD]: Porfavor, no hagas doble post, está prohibido.
|
|
|
4
|
Programación / Scripting / Ayuda con FOR
|
en: 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
|
|
|
|
|
|
|