Egsuh thanks for the answer, I think the solution is to join the CSV files in one, my main problem is that the CSV files are coming to me in rows, so it does not meet the structure of the DB, in order to insert the data correctly I must convert the CSV data to columns.
data1,data2,data3...
convert to.
data1
data2
data3
.
.
Thank you very much for your attention.
Do the coversion in Excel manually. If your file is small,
1. Open it in Excel. Then there would be a long row.
2. Copy the row, and paste it with column/row converted in a new sheet.
This is the simplelist. Just a few mouse clicks.
Once all four files are done, copy the columns into one Sheet and save it as a new CSV file.
If your files are very large, I suggested to use read statement, similar to FORTRAN method.
read (f1, aninteger) will read in only one integer number (not the whole line), if your data are delimited with blank (not sure about comma). So,
while not eol(f1) do begin
read (f1, aninteger);
writeln(f2, aninteger);
end;
will convert row to column.
If your files are medium sized, using TStringList may be better.
readln (inf1, s); StringList1.CommaText := s;
readln(inf2, s); StringList2.Commatext := s;
readln(inf3, s); StringList3.Commatext := s;
readln(inf4, s); StringList4.Commatext := s;
for ti:= 0 to AStringList.Count-1 do
writeln(outf, StringList1[ti], ',', StringList2[ti],',',
StringList3[ti],',', StringList4[ti]);
You may make a new file in this way.