Tools or Ways of csv,txt files write to database
-
Greetings,
I'm trying to use Qtsql with Database right now,
It seems like I am able to try to use some delimiter-separated values files to modify my Database
with csv files.
So that It makes it possible for someone else to modify my database according a csv file without changing my program.(some kind of interface I guess)the file might be like:
<CreateTables> <!--增加表 --> <Table> <TableName>Student1</TableName> <!--表的名字 --> <FieldList>Name|Age|Gender</FieldList> <!--字段名字 用|来分割 字段个数和字段类型数一定要一一对应--> <FieldTypeList>VARCHAR(32)|INT|VARCHAR(8)</FieldTypeList> <!--字段类型 用|来分割--> </Table> <Table> <TableName>Student2</TableName> <!--表的名字 --> <FieldList>Name|Age|Gender</FieldList> <!--字段名字 用|来分割--> <FieldTypeList>VARCHAR(32)|INT|VARCHAR(8)</FieldTypeList> <!--字段类型 用|来分割 字段个数和字段类型数一定要一一对应--> </Table> </CreateTables>
But I'm not sure is there any documents cause I have googled and found nothing,
including all the syntax in the csv file, class I should try to use and so on
Thanks in advance.
Regards. -
Guess I'm missing the point, the main problem is to read a xml file with Qt, then I would be able to use xml's message (insert charts, add columns) as a regular sql order.
-
@Puppy-Bear said in Tools or Ways of csv,txt files write to database:
It seems like I am able to try to use some delimiter-separated values files to modify my Database
The above is not a CSV file, it's an XML file. Looks like some description of the fields in tables.
How do you/users use this to alter data in the database? And what does it have to do with Qt?