0

i can't find the code to read for particular info from textfile. is that even possible?

eg. [data store in text file]
01/11/2009 12:30:22,1
01/11/2009 12:35:22,2
01/11/2009 12:55:22,1
01/11/2009 13:30:22,0
01/11/2009 13:59:22,1
01/11/2009 14:30:22,0
02/11/2009 15:30:22,1
02/11/2009 15:45:22,0
02/11/2009 16:30:22,1
02/11/2009 16:55:22,0

and i'm calling the date 01/11/2009

so the system will read all data in 01/11/2009
how do i go about doing that and than after read i need to display the data on to the grid
with separation of
date one column time one column

4
Contributors
3
Replies
5
Views
7 Years
Discussion Span
Last Post by sathishkumar.j
0

Try something like "Read the textfile and push into some hashtable and search using the datekey".

0

1.Save ur test file in to the local hard disk whether d: or e:

2.Using this code and execute in the Sql server 2005

create table #testDate(myDate varchar(50),MyNo int)

Bulk insert #testDate from 'd:\testdate.txt' WITH
(
FIELDTERMINATOR =',',
ROWTERMINATOR ='\n'
)

select substring(mydate,0,11) MyDate,myno from #testdate

3. Now u can get wat u want...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.