0
You guys, good morning.
I have the following problem.
I have some txt-like bank statements files that I need to play on for a dataframe, until they have a sort of standard layout. I need to take only the lines of the accounting releases (lines that have dt.movement the rest can disregard), I tried a little here and even managed to get the lines with the command line.split(' t') but they are not separated by tabulation (TAB)
I wonder if anyone can help me with this problem.
TXT FILE
================================================================================================================================================================
Extrato conta corrente                                                                                                                       5152152141421124144
                                                                                                                                             11/12/2018 15:57:30
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Cliente - Cliente atual
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Agência                       3214-1
Conta corrente                2341-1 XPTO ENTERPRISE
Período do extrato            
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Lançamentos
----------------------------------------------------------------------------------------------------------------------------------------------------------------
 Dt. movimento  Dt. balancete    Ag. origem        Lote     Histórico                                    Documento         Valor R$            Saldo
   29/11/2018                       0000          00000     000 Saldo Anterior                                                            9.104,88 C
   05/12/2018                       0000          13113     435 Tarifa Pacote de Serviços      432.432424.24234.43         128,00 D       8.976,88 C
                              Tarifa referente a 05/12/2018
   10/12/2018                       0000          14175     976 TED-Crédito em Conta                     7.962.643      15.000,00 C      23.976,88 C
                              341 0192 56998438000165 EMPRESA ABC
   10/12/2018                       0000          13013     364 BB Consórcio - Prestação                    12.068       1.264,91 D      22.711,97 C
   10/12/2018                       0000          13013     364 BB Consórcio - Prestação                    23.068       1.264,90 D      21.447,07 C
   10/12/2018                       0000          13013     364 BB Consórcio - Prestação                    23.068       1.264,91 D      20.182,16 C
   10/12/2018                       0000          13013     364 BB Consórcio - Prestação                    51.068       1.264,91 D      18.917,25 C
   10/12/2018                       0000          13013     364 BB Consórcio - Prestação                    21.068       1.264,91 D      17.652,34 C
   10/12/2018                       0000          13013     364 BB Consórcio - Prestação               	   543.068     	 1.264,91 D    	  16.387,43 C
   10/12/2018                       0000          13013     364 BB Consórcio - Prestação                    23.068       1.264,91 D      15.122,52 C
   10/12/2018                       0000          13013     364 BB Consórcio - Prestação                    31.068       1.264,91 D      13.857,61 C
   10/12/2018                       0000          13013     364 BB Consórcio - Prestação                    74.068       1.264,91 D      12.592,70 C
   10/12/2018                       0000          13013     364 BB Consórcio - Prestação                    23.068       1.264,91 D      11.327,79 C
   10/12/2018                       0000          13013     364 BB Consórcio - Prestação                    61.068       1.264,91 D      10.062,88 C
   10/12/2018                       0000          13013     364 BB Consórcio - Prestação                    23.068       1.264,91 D       8.797,97 C
   11/12/2018                       0000          00000     999 S A L D O                                                8.797,97 C       8.797,97 C
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Saldo                                                                 8.797,97 C
Juros                                                                       0,00
Data de Debito de Juros                                               31/12/2018
IOF                                                                         0,00
Data de Debito de IOF                                                 02/01/2019
----------------------------------------------------------------------------------------------------------------------------------------------------------------
               ------------------------------------------------
               ------------------------------------------------
               OBSERVAÇÕES:
               ------------------------------------------------
               
               
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Transação efetuada com sucesso por: 234252 GENESIO MARINHO

Most banks in Brazil, if not all, offer extracts in format
.ofx(Open Financial Exchange), the best way is to download in this format and use an appropriate tool to extract the information, for example the ofxtools.– Sidon
By the way... The format
ofxis an m#rda (an expression of even more macorronic xml) but it is the standard of the banks (perhaps imposed by the Quiken data standard), and since it had a "good soul" to parse for python, because it does not take advantage of it?– Sidon