Shura16
Ubbergeek
Registrado
2.5K Mensagens
601 Curtidas
xDBZx
Novo Membro
Registrado
2 Mensagens
1 Curtida
Acho bom você dar uma olhada neste comando:
https://technet.microsoft.com/pt-br/library/Cc753864(v=WS.10).aspx
Com ele é possível comparar as diferenças entre arquivos.
Aqui mostra como é possível copiar o resultado do comando para um arquivo texto.
http://br.ccm.net/faq/12612-copiar-os-resultados-de-um-comando-dos
Sobre a execução, você pode agendar a execução no Windows.
https://support.microsoft.com/pt-br/kb/226795
Acho que estes links podem ajudar a começar. Quando tiver o começo e se surgir alguma dúvida poste aqui.
Brigadao Shura16
Consegui fazer
Ele faz exatamente o que precisava, compara dois arquivos e gera um terceiro somente com o que foi implementado
service.log
1 2 3
service1.log
1 2 3 4 5 6
E o terceiro arquivo ficou assim
Comparando os arquivos service.log e SERVICE1.LOG
***** service.log
***** SERVICE1.LOG
4 5 6
*****
O código deu 1 linha só
@echo off
rem //-----------------------------------------------------------------------------
rem /*/{Batch.doc} CompareFiles.bat
rem Batch responsável por comparar 2 arquivos e gerar um terceiro somente com o que foi implementado
rem
rem @author Sérgio Seiji Naka
rem @since 14/08/2015
rem /*/
rem //-----------------------------------------------------------------------------
rem /c Ignores the letter case.
rem /l Compares the files in ASCII mode, line-by-line, and attempts to resynchronize the files after finding a mismatch.
rem /t The default behavior is to treat tabs as spaces, with stops at each eighth character position.
rem /w If a line contains many consecutive spaces or tabs, /w treats these characters as a single space.
rem /lb If the files that you are comparing have more than 100 consecutive differing lines, fc cancels the comparison.
FC /c /l /t /w /lb 100000 service.log service1.log >C:\teste\aaa.log