如何从文本文件中读取一组字符串并使用C编程插入到DB中 [英] How to read a set of strings from text file and insert into DB using C programming

查看:79
本文介绍了如何从文本文件中读取一组字符串并使用C编程插入到DB中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从文本格式读取一组字符串并使用C代码写入数据库

How to read a set of strings from text format and write into DB using C code

推荐答案

您必须:

You have to:
  1. 解析文本文件以提取所需信息。
  2. 在数据库中插入此类信息。





1 任务的复杂性当然取决于文本文件的结构方式(例如解析CSV [ ^ ]文件非常简单。)



一旦你与你喜欢的数据库建立连接,你可以执行第2点只需嵌入 SQL INSERT [ C 代码中的_blanktitle =New Window> ^ ]命令。



The complexity of point 1 task, depends, of course, on the way the text file is structured (e.g. parsing a CSV[^] file is pretty strightforward).

Once you have a connection with your favourite database, you may perform point 2 simply embedding SQL INSERT[^] commands in your C code.


这篇关于如何从文本文件中读取一组字符串并使用C编程插入到DB中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆