从文本文件创建数据库

编程入门 行业动态 更新时间:2024-10-28 05:12:33
本文介绍了从文本文件创建数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个从考勤机取出的文本文件。我想将文本文件放入数据库文件(如sql,ms访问等) 我的文本文件格式如下: 0012803151737460000000591011ùó can你知道如何阅读这个文件 前3位数 - 机器号码(虽然我有一台机器) 下两位数 - 日期 下两位数 - 月 下两位数 - 年 下两位数 - 小时 下两位数 - 分钟 下两位数 - 第二 下十位数 - 卡号 休息 - 不知道(可能显示存在/缺席) 感谢任何建议和帮助 提前感谢。

i have a text file which fetched from attendance machine. i want the text file into a database file (like sql, ms access etc) my text file format is below: 0012803151737460000000591011ùó can u plz suggest me of how to read this file first 3 digit - machine number (though i have one machine) next two digit - date next two digit - month next two digit - year next two digit - hour next two digit - minute next two digit - second next ten digit - card number rest - dont know (probably showing present/absent) appreciate for any kind of suggestion and help thanks in advance.

推荐答案

此帖的接受答案[ ^ ]提供了一个关于加载此natur的文本文件的优秀教程使用SSIS进入SQL Server。 如果您无法使用SQL Server(或只能访问Express版本),那么您可能需要编写一个程序首先读取文件,将行拆分并存储到您拥有的任何数据库。具体如何执行此操作取决于您决定使用哪个数据库,以及选择/熟悉哪种编程语言。无论你选择哪种组合,Code Project上的文章一定会对你有帮助。 如果你选择使用MS Access(我不会)那么你可以在VBA中做到这一点(我不建议这样做)。再次,你可以谷歌的例子来帮助你。 The accepted answer to this post[^] gives an excellent tutorial on loading text files of this nature into SQL Server using SSIS. If you are not able to use SQL Server (or only have access to the Express versions) then you will probably need to write a program to first read the file, split the lines up and store to whichever database you have. Exactly how to do this will depend on which database you decide to use, and which programming language to pick / are familiar with. Whichever combination you choose there are bound to be articles here on Code Project that will help you. If you choose to use MS Access (I wouldn't) then you could do this in VBA (I don't recommend this). Again you can google for examples to help you along.

更多推荐

从文本文件创建数据库

本文发布于:2023-07-09 00:18:09,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1082114.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文本文件   数据库

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!