| | |
|
Active Server Pages what is asp programming how to sample asp example code scripts software asp forum mail sessions applications global.asa CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
Re: Counting lines in a text file |
From: |
Nazim Can BEDIR |
Date: |
8/3/2000 10:04:21 AM |
IP: |
213.186.128.252 |
The codes are below...
<% Dim textFSO, text, line
Set textFSO=CreateObject("Scripting.FileSystemObject")
Set text=textFSO.OpenTextFile("your files path", 1,0) %>
line=text.ReadAll %>
<%=line%>
Or
<% Dim textFSO, text, line
Set textFSO=CreateObject("Scripting.FileSystemObject")
Set text=textFSO.OpenTextFile("your files path", 1,0)
Do
line=text.ReadLine %>
<%=line%>
<% Loop Until text.AtEndOfStream
text.Close %>
If you want read 5 line...
<% Dim textFSO, text, line, counter
counter=0
Set textFSO=CreateObject("Scripting.FileSystemObject")
Set text=textFSO.OpenTextFile("your files path", 1,0)
Do
If counter<5 Then
counter=counter+1
line=text.ReadLine
End If %>
<%=line%>
<% Loop Until text.AtEndOfStream
text.Close %>....
|
Previous Message
|
|
|
|
|
|