如何在文本文件中按行检查数据 [英] How Can I Check Data In Textfile Rowwise

查看:97
本文介绍了如何在文本文件中按行检查数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想检查文本文件中的数据并检查数据库中是否存在该记录。



if(No)



我想用新记录更新数据库(删除冗余),数据库中没有主要约束。





任何人都可以给我建议。





谢谢

解决方案

< blockquote>将文件加载到您的应用程序中 - 您没有说它是什么

将数据解析为集合 - 您没有说明数据的格式

创建一个连接到数据库 - 你没有说你的数据库是什么

使用存储过程或文本SQL查询来查找匹配记录的存在

插入记录如果没有匹配

重复集合中的每个项目。


I want to check data in the text file and check whether that record is present in Database or not.

if(No)

I want to update database with new records(remove redundant) and no primary constraint in database.


Can any one give me suggestion.


Thanks

解决方案

Load the file into your application - you do not say what it is
Parse the data into a collection - you do not say what format the data is
Create a connection to the database - you do not say what your database is
Use either a stored procedure or text sql query to look for the existence of a matching record
Insert the record if there is no match
repeat for each item in the collection.


这篇关于如何在文本文件中按行检查数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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