A possible technical repair1 is to use a Tstringlist:
var
Colunas : TStringlist;
begin
Colunas := TStringlist.Create;
Colunas.Text := StringReplace('00:46:30@21/08/2014@Carlos dos Santos@São Paulo',
'@',Char(13)+Char(10),[rfReplaceAll]);
Tstringlist internally uses the sequence CR
LF
to separate items, so the above code transforms a long line into several separate items, by changing the @
in sequence CR
LF
Edit: As well remembered by Edgar Muniz Berlinck, the Tstringlist has a property to break the string by other delimiters, thereby:
var
Colunas : TStringlist;
begin
Colunas := TStringlist.Create;
Colunas.Delimiter := '@';
Colunas.DelimitedText := Linhas[i];
1. gambiarra
thanks for the answer. I didn’t understand one thing, how will I use it ? type I wanted to use as follows $coluna1, $coluna2, for each text before the @.
– user7605
thanks. Remembering that I have a file called client.txt and within it several lines of this. If you can help me with that too I appreciate it, it should go through this whole file.
– user7605
@user7605 to read the file line by line I think it’s best to ask a separate question.
– Bacco
I can test here now ?
– user7605
handed out manually. Now I need to do by reading a txt file, I must ask another question ?
– user7605
@user7605 I think it’s better, just not to mix the two subjects. So this question is for those who in the future need the explode for other things.
– Bacco
I’m doing @Bacco, thank you so much!
– user7605