I'm quite sorry, but I'm having a hard time understanding you; you will find a sketch attached how such a task could be done in principle and it's up to you to fit it to your concrete requirement.
@
bool importFile(const QString &fileName)
{
QFileInfo fileInfo(fileName);
if(fileInfo.exists() == false)
return false;
QSqlQuery query;
query.prepare("INSERT INTO " +
QLocale(QLocale::English).toString(fileInfo.lastModified().addDays(-1),
"MMMM").toLower() +
"_ama (answer, ..., offset) VALUES (?, ..., ?)");
do
{
readNextRecordFromFile();
query.addBindValue(readNextValueFromRecord());
...
query.addBindValue(readNextValueFromRecord());
}
while ((query.exec() == true) && (lastRecordRead() == false));
return ((query.isActive() == true) && (lastRecordRead() == true));
}
@
Brain to terminal. Exemplary.
And make sure you've had a good read on C++, design principles, Qt and the Qt SQL module.