从文本文件创建数据库 [英] Create a Database from text file

查看:95
本文介绍了从文本文件创建数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个从考勤机取出的文本文件。我想将文本文件放入数据库文件(如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.


这篇关于从文本文件创建数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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