![]() |
![]() |
![]() |
![]() |
![]() |
FTP | ![]() |
![]() |
CCD | ![]() |
![]() |
Buscar | ![]() |
![]() |
Trucos | ![]() |
![]() |
Trabajo | ![]() |
![]() |
Foros | ![]() |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
|||
|
|||
Remplazar texto en fichero
He visto este código aquí en club delphi he intentado utilizarlo y me tira estos errores:
[DCC Warning] CambiaTexto.pas(35): W1019 For loop control variable must be simple local variable [DCC Error] CambiaTexto.pas(37): E2003 Undeclared identifier: 'StuffString' [DCC Fatal Error] Project1.dpr(5): F2063 Could not compile used unit 'CambiaTexto.pas' Alguien me puede explicar un poco, incluyo toda la unit. Disculpar las molestias soy muy novato. unit CambiaTexto; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm2 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form2: TForm2; ss : TStringList; I: integer; implementation {$R *.dfm} procedure TForm2.Button1Click(Sender: TObject); begin ss := TStringList.Create; ss.LoadFromFile('c:\xxx\archivo.txt'); //ss.Text := StringReplace(ss.text,'22.150 ','22.250 ',[rfReplaceAll]); for I := 0 to (ss.count -1) do if sametext(copy(ss.strings[i], 117, length('21.250')), '21.250') then ss.strings[i] := StuffString('21.250', 117, length('21.250'), '22.250'); ss.SaveToFile('c:\xxx\archivo.txt'); end; end. |
Herramientas | Buscar en Tema |
Desplegado | |
|
|
![]() |
||||
Tema | Autor | Foro | Respuestas | Último mensaje |
Fichero de Texto: Log.txt | jsc | Varios | 2 | 16-09-2011 18:48:40 |
Cortar Fichero de texto. | johurgi | Varios | 3 | 03-04-2008 15:41:29 |
Fichero de Texto Enorme | muli | Varios | 8 | 19-02-2008 02:23:35 |
verificar fichero de texto | arley_molina | Varios | 2 | 12-06-2006 20:52:40 |
leer fichero de texto | davidgaldo | Varios | 1 | 08-11-2005 15:05:12 |
![]() |
|