Caro Jose Nao posso explicar muito bem em Portugues, mas criei um exemplo que pode ajuda-lo:
procedure TForm1.Button1Click(Sender: TObject); var s, st1,st2: string; oint: integer; f: textfile; begin AssignFile(f, 'CaminhoENomeDoTextoArquivo'); Reset(F); while not Eof(f) do ReadLn(f,s); s:= StringReplace(s,#34,'',[rfReplaceAll]); st1:= copy(s,1,pos(',',s)-1); ?? separador e uma virgula delete(s,1,pos(',',s)); oint:= strtoint(copy(s,1,pos(',',s)-1)); delete(s,1,pos(',',s)); st2:= s; // Aqui gravar os dados para o banco, por exemplo: // INSERT INTO Table(Col1,Col2,Col3) VALUES(:val1,:val2,:val3) // Parameters.ParamByName(;val1).Value:= st1; // Parameters.ParamByName(;val1).Value:= oint; // Parameters.ParamByName(;val1).Value:= st2; // ExecSQL; CloseFile(F); end; Atenciosamente Steve -----Original Message----- From: delphi-br@yahoogrupos.com.br [mailto:delphi...@yahoogrupos.com.br] On Behalf Of Ferreira Sent: 04 November 2009 14:05 To: delphi-br@yahoogrupos.com.br Subject: [delphi-br] Ajuda - Importar TXT p/DB com delimitador Caros Colegas do Grupo. Preciso de uma ajuda na importação de dados de um arquivo TXT que tem delimitadores de texto, p/que eu possa gerar uma tabela temporária. Se o texto estivesse em um local determinado era beleza, mas está com delimitadores. Segue a baixo uma linha do arquivo para Vcs terem uma idéia. Obs.: Os dados do tipo varchar estão entre aspas duplas e numérico não, e estão separados por virgula. "Grupo 90";1331;"90.00" Grato, José Ferreira ------------------------------------ *************************************************************************** This e-mail and any files transmitted with it are confidential. If you are not the intended recipient, any reading, printing, storage, disclosure, copying or any other action taken in respect of this e-mail is prohibited and may be unlawful. If you are not the intended recipient, please notify the sender immediately by using the reply function and then permanently delete what you have received. Content of emails received by this Trust will be subject to disclosure under the Freedom of Information Act 2000, subject to the specified exemptions, including the Data Protection Act 1998 and Caldicott Guardian principles. This footnote also confirms that, unless otherwise stated, this email message has been swept by Sophos Anti-virus for the presence of computer viruses. ** Please consider the environment before printing this email. ** ***************************************************************************