% EnableSessionState=False %> <% ' a simple look up for data in a tab delimited spreadsheet. ' the text file is taken in and processed. and then we loop through ' the content and show those that match the inputted state abbrev. ' * the state abbreviation that is sent in has to be sent in as a query string ' http://www.whatever.com?state=NY ' and then abbreviations have to be the same as in the text file. ' ' *make sure to fill-in the full path for the source file ' Dim source_file Dim file_obj Dim file_handle Dim file_content Dim all_lines Dim number Dim state Dim count source_file = "d:/webs/websites/samiiland.com/info2_new.txt" ' source_file = "d:/InetPub/WWWRoot/sammi/www/info2_new.txt" state= Request.QueryString("state") 'here we get the file Set file_obj = Server.CreateObject("Scripting.FileSystemObject") Set file_handle = file_obj.OpenTextFile(source_file) file_content = file_handle.ReadAll file_handle.Close Set file_handle = nothing Set file_obj = nothing all_lines = SPLIT(file_content, vbNewLine) count = 0 %>
<% for each line in all_lines if line <> "" then temp_array = SPLIT(line, vbTab) if state = temp_array(3) then count = 2 %> <%=temp_array(0)%>
<%=temp_array(1)%>
<%=temp_array(2)%>
<%=temp_array(3)%> <%=temp_array(4)%>
<%=temp_array(5)%>
<% end if end if erase temp_array next if count = 0 then %> There are no stores in that state. <% end if %>