Clipper On Line • Ver Tópico - Comparar arquivos txt
Mudar para estilo Clássico
Aqui você poderá oferecer suas Contribuições, Dicas e Tutoriais (Texto ou Vídeo) que sejam de interesse de todos.
Postar uma resposta

Comparar arquivos txt

08 Jan 2020 15:09

Procurei na internet, mas só encontrei programas que mostram linhas diferentes.
Tem algum utilitário prático pra isso?

Criei um simples, mas acho que vai longe pra ficar mais útil

Código:
PROCEDURE Main

   LOCAL aTxt1, aTxt2, nCont
   SetMode( 50, 100 )
   CLS
   aTxt1 := hb_RegExSplit( hb_Eol(), MemoRead( "d:\jpa\ro\exporta\simpok.txt" ) )
   aTxt2 := hb_RegExSplit( hb_Eol(), MemoRead( "d:\jpa\ro\exporta\simp1912.txt" ) )
   ? Len( aTxt1 )
   Inkey(0)
   FOR nCont = 1 TO Len( aTxt1 )
      Show( aTxt1[ nCont ], aTxt2[ nCont ] )
   NEXT
   Inkey(0)

   RETURN

FUNCTION Show( cTxt1, cTxt2 )

   LOCAL nCont

   IF cTxt1 == cTxt2
      RETURN NIL
   ENDIF
   Scroll( 0, 0, 50, 100, 1 )
   FOR nCont = 1 TO Len( cTxt1 )
      @ 49, nCont - 1 SAY Substr( cTxt1, nCont, 1 ) COLOR ;
         iif( Substr( cTxt1, nCont, 1 ) <> Substr( cTxt2, nCont, 1 ), "W/R", "W/B" )
   NEXT

   RETURN NIL


dif.png

Comparar arquivos txt

08 Jan 2020 18:18

Olá!

Costumo utilizar o BeyondCompare. Me atende.
Postar uma resposta