aboutsummaryrefslogtreecommitdiff
path: root/client/csv_import.cpp
blob: 55077540445b31be0a3b040ed6cbdbf09a394216 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "csv_import.h"

CSV_Import::CSV_Import()
{

}


#include <QString>
#include <QVector>

QString CSV_Import::csvToSql(QString input){

    QVector<QString> data;
    QString output = "(";

    data = input.split(",");

    for (int i = 1; i < data.size(); ++i) {

        bool valid;
        output.append(QString::number(data[i].toInt(&valid, 16)));

        if (i <= data[i].size()) {
            output.append(",");
        }

    }
    output.append(")");

    return output;
}