Olá!!
Não está adicionando o nome da última coluna do arquivo csv no ComboBox. Alguma sugestão?
procedure TFMF.Bt_LoadClick(Sender: TObject);
Var
i,j,Inicol: Integer;
SVal,Ch : String;
TxtFile: TextFile;
begin
OpenF.Filter:= 'CSV file|*.csv|Text file|*.txt';
OpenF.Title:= 'Abrir arquivo';
OpenF.FilterIndex:= 1;
OpenF.Options:=[ofshowhelp,offilemustexist];
OpenF.Execute;
FName:=OpenF.FileName;
AssignFile(TxtFile, FName);
Reset(TxtFile);
ReadLn(TxtFile, Ch);
IniCol:=1;
for j:=1 to Length(Ch)
do begin
if (Copy(Ch,j,1)=',') or (Copy(Ch,j,1)=';') or (Copy(Ch,j,1)='#9') or (Copy(Ch,j,1)='') then begin
SVal:= Copy(Ch,IniCol,j-IniCol);
ComboBox1.Items.Add(SVal);
ComboBox2.Items.Add(SVal);
ComboBox3.Items.Add(SVal);
IniCol:=j+1;
end;
end;
end;
Obrigado.