Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 24-10-2007
yue20023 yue20023 is offline
Registrado
 
Registrado: jul 2006
Posts: 2
Poder: 0
yue20023 Va por buen camino
Exclamation ayuda con un txt

tengo una aplicacion que elabore y me deja limpiar archivos txt el problema es que quiero que no me borre 2 lineas y no puendo encontrar la solucion el archivo original es el siguiente


http://usuarios.lycos.es/yuehang/Copia de uv8922304275aa.txt

quiero dejar la linea en donde dice oficinas y la linea en donde dice siniestro pero no me queda mi codigo es el siguiente :

Código Delphi [-]
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Label1: TLabel;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  fsarchivoaleer : TextFile;
  fsarchivosalida :TextFile;
  s,s1:string;
begin
  if fileExists(Edit1.Text) then begin
    AssignFile(fsarchivoaleer,Edit1.Text);
    rReset(fsarchivoaleer);
    AssignFile(fsarchivosalida,Edit1.Text+'o');
    Rewrite(fsarchivosalida);
    while not eof(fsarchivoaleer) do begin
      readln(fsarchivoaleer,s);
        if length(trim(s))>0 then begin
        if s[1] in ['O','-','_','S'] then begin
          s:=''
        end else begin
          if s[1]='0' then begin
            if length(trim(s1))>0 then
              writeln(fsarchivosalida,s1);
            s1 := s;
          end else
          if s[1]<> '-' then begin
            if s[1]='R' then begin
                if s[67]='' then
                  s := copy(s,1,66);
                s1 := s1+' '+s;
            end;
          end else
          if s[64] in ['0','1','2','3','4','5','6','7','8','9'] then
            s1 := s1+ ' '+ copy(s,62,67);
        end;

      end;
    end;
    CloseFile(fsarchivosalida);
    CloseFile(fsarchivoaleer);
  end;

end;

end.

por favor ayudenmeeeeeeeee!!!!!!!!!!
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Instalar Ayuda (.HLP) en la Ayuda de Delphi? MasterXP Varios 6 12-04-2006 06:57:49
Ayuda para crear ayuda... Gabriel2 Varios 2 10-06-2005 00:15:18
Leer la ayuda... Ayuda! MaJeSTiC Varios 0 04-08-2004 21:24:42
ayuda con strtofloat, ayuda punto flotante TURING Varios 5 30-04-2004 08:03:59
Ayuda Con Instalacion De Archivos De Ayuda Legolas Varios 1 01-12-2003 14:48:03


La franja horaria es GMT +2. Ahora son las 03:25:51.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi