USUÁRIO:      SENHA:        SALVAR LOGIN ?    Adicione o VBWEB na sua lista de favoritos   Fale conosco 

 

  Fórum

  Visual Basic
Voltar
Autor Assunto:  strings duplicadas
jucabolha
SÃO PAULO
SP - BRASIL
ENUNCIADA !
Postada em 28/02/2007 19:19 hs            

 

Eu recebo um arquivo txt como segue abaixo.  Note que na linha que inicia com "09085" após os espaços esta um campo que inicia com "1" ,"2",etc.  Acontece que este numero significa as prestações, e eu gostaria de eliminar as linhas que possuem o mesmo inicial, porque, como podem ver, quando são 2 prestações ele tem duas linhas com o numero 2, quando são 3 prestações ele tem 3 linhas e por ai vai.  Então eu gostaria de saber se existe algum modo de eliminar estas linhas duplicadas .

agradeço

João CArlos

 

 

0202655032   ALVES  DEL NERO                          

0305454004   AV ASTRO 415

09085                                                  1 1 120320070000000091696

09085                                                  2 1 120320070000000046076

09085                                                  2 2 120420070000000046076

09085                                                  3 1 120320070000000030870

09085                                                  3 2 120420070000000030870

09085                                                  3 3 120520070000000030870

09085                                                  4 1 120320070000000023267

09085                                                  4 2 120420070000000023267

09085                                                  4 3 120520070000000023267

09085                                                  4 4 120620070000000023267

09085                                                  5 1 120320070000000037412

09085                                                  5 2 120420070000000037412

09085                                                  5 3 120520070000000037412

09085                                                  5 4 120620070000000037412

09085                                                  5 5 120720070000000037412

09085                                                  6 1 120320070000000031331

09085                                                  6 2 120420070000000031331

09085                                                  6 3 120520070000000031331

09085                                                  6 4 120620070000000031331

09085                                                  6 5 120720070000000031331

09085                                                  6 6 120820070000000031331

09085                                                  7 1 120320070000000026987

09085                                                  7 2 120420070000000026987

09085                                                  7 3 120520070000000026987

09085                                                  7 4 120620070000000026987

09085                                                  7 5 120720070000000026987

09085                                                  7 6 120820070000000026987

09085                                                  7 7 120920070000000026987

09085                                                  8 1 120320070000000023730

09085                                                  8 2 120420070000000023730

09085                                                  8 3 120520070000000023730

09085                                                  8 4 120620070000000023730

09085                                                  8 5 120720070000000023730

09085                                                  8 6 120820070000000023730

09085                                                  8 7 120920070000000023730

09085                                                  8 8 121020070000000023730

09085                                                  9 1 120320070000000021197

09085                                                  9 2 120420070000000021197

09085                                                  9 3 120520070000000021197

09085                                                  9 4 120620070000000021197

09085                                                  9 5 120720070000000021197

09085                                                  9 6 120820070000000021197

09085                                                  9 7 120920070000000021197

09085                                                  9 8 121020070000000021197

09085                                                  9 9 121120070000000021197

09085                                                  101 120320070000000019171

09085                                                  102 120420070000000019171

09085                                                  103 120520070000000019171

09085                                                  104 120620070000000019171

09085                                                  105 120720070000000019171

09085                                                  106 120820070000000019171

09085                                                  107 120920070000000019171

09085                                                  108 121020070000000019171

09085                                                  109 121120070000000019171

09085                                                  1010121220070000000019171

0202655504   MARIA  PEREIRA               

0305455788   RUA QUARTEL  36

09084                                                  1 1 120320070000000036627

09084                                                  2 1 120320070000000018405

09084                                                  2 2 120420070000000018405

09084                                                  3 1 120320070000000012331

09084                                                  3 2 120420070000000012331

09084                                                  3 3 120520070000000012331

09084                                                  4 1 120320070000000009294

09084                                                  4 2 120420070000000009294

09084                                                  4 3 120520070000000009294

09084                                                  4 4 120620070000000009294

09084                                                  5 1 120320070000000014944

09084                                                  5 2 120420070000000014944

09084                                                  5 3 120520070000000014944

09084                                                  5 4 120620070000000014944

09084                                                  5 5 120720070000000014944

09084                                                  6 1 120320070000000012515

09084                                                  6 2 120420070000000012515

09084                                                  6 3 120520070000000012515

09084                                                  6 4 120620070000000012515

09084                                                  6 5 120720070000000012515           

    

   
LCRamos
Pontos: 2843
GOIANIA
GO - BRASIL
ENUNCIADA !
Postada em 28/02/2007 21:51 hs            
Veja elimine na leitura:
Dim sNUM As String
Dim suNUM As String
Dim sLINHA As String
sNUM = "0"
suNUM = "0"
Open "SeuArquivo" For Input As #1
  Do While Not EOF(1)
   Line Input #1, sLINHA
   sNUM = Left(sLINHA, 1)
   If sNUM <> suNUM Then
     FAÇA AQUI SEU EVENTO
   End If
   suNUM = sNUM
 Loop
 
Entendeu??
 
vlu//
 
   
LCRamos
Pontos: 2843
GOIANIA
GO - BRASIL
ENUNCIADA !
Postada em 28/02/2007 21:54 hs            
Lógico que vc terá que testar se é novo cliente, e também a posição do numero da prestação de acordo com a posição no arquivo, neste caso use o Mid(sLINHA, posição, 1)
 
VLU//
   
joao carlos
não registrado
ENUNCIADA !
Postada em 01/03/2007 10:57 hs   
valeu.  Obrigado pela dica
JC
   
Página(s): 1/1    


Seu Nome:

Seu eMail:

ALTERAR PARA MODO HTML
Mensagem:

[:)] = 
[:P] = 
[:(] = 
[;)] = 

HTML DESLIGADO

     
 VOLTAR

  



CyberWEB Network Ltda.    © Copyright 2000-2024   -   Todos os direitos reservados.
Powered by HostingZone - A melhor hospedagem para seu site
Topo da página