1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| begin
St:=TStringList.Create;
St.LoadFromFile('D:\IN\02132.txt');
showmessage(inttostr(st.Count+1));
for j:=0 to iNbreLignes do
begin
st.ValueFromIndex[j];
S:=st.Strings[j];
NoIdentificador := Copy(S,3,5);
Hora := Copy(S,10,8);
NoLote := Copy(S,19,6);
Posicion := Copy(S,26,4);
Referencia := Copy(S,31,13);
Cantidad := Copy(S,59,1);
Fecha := Copy(S,61,10);
ModoRegistro := Copy(S,1,1);
ADOQuery1.SQL.Clear;
ADOquery1.SQL.Add('INSERT INTO Importacion ([NoIdentificador], [Hora], [NoLote], [Posicion], [Referencia], [Cantidad], [Fecha], [ModoRegistro]) VALUES ("'+NoIdentificador+'", "'+Hora+'", "'+NoLote+'", "'+Posicion+'", "'+Referencia+'", "'+Cantidad+'", "'+Fecha+'", "'+ModoRegistro+'");');
ADOQuery1.ExecSQL;
end;
end; |
Partager