Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Updated 22-May-15 22:05pm
v2
Comments
OriginalGriff 23-May-15 4:53am    
And?
What have you tried?
Where are you stuck?
What help do you need?
Why are you trying to do this in SQL? Wouldn't C# or even VB be better?
seyed mahmud shahrokni 23-May-15 8:15am    
is there any programming layer between machine and DBMS ?! they cant connect to each other directly ! if you have a programming layer between your machine and DBMS you will able to make a query which returns answers from data base .

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900