Hi,
How can I convert a text file (.txt) into SQL in ASP.net 2.0 ? The sample of the file format is like that ...
09/03/2007 08:41 "Fung, Kitty" Granted Access D1 Main 2354 111
09/03/2007 08:42 "Ng, Jaclyn" Granted Access D1 Main 21906 18
09/03/2007 08:42 "Leung, Agnes" Granted Access D1 Main 21920 18
Cheers
Hi Stephen Ho,
How do you want to convert this text file into SQL?
|||
This is not standard text file (comma delimited or fixed fields) so you have to create your own parser so write application which will :
1 read line of text
2 parse line to fields (if you need data in fields)
3 insert fields into table row (or whole line as single field content)
4 check if next line exists and if yes go to step 1
but maybe you can change the format how your events are logged to file for example to comma delimited format and it will be easier to import it to SQL using SSIS package.
No comments:
Post a Comment