Shared Tutorials
Tutorials Shared by the Internet Community
Advertisements
| Top Tutorials | New Tutorials | Submit | Login | Register |
Tutorial Basic Detail
Counting lines in text files
In this sample ASP code, we will read and count the lines in a text file.http://www.devtutorials.info/articles/8_Counting_lines_in_text_files.asp
Total Hits: 2899
Total Votes: 36 votes
Average Rating: 2.5 out of 5
Category: ASP/File Manipulation
Description:
In this sample ASP code, we will read and count the lines in a text file. This study uses FileSystem Object and readline method.Sample Code:
<%
strLine=""�
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(Server.MapPath("404.asp"))
�Do
�� objFile.ReadLine
�� �i = i + 1
������ �Loop Until objFile.AtEndofStream
��objFile.Close
�response.write ("There are "& i &" lines in sample text file.")
%>
Rating Detail
| Stars | Percentage | Total Vote |
|---|---|---|
![]() |
![]() ![]() 16.67% |
6 |
![]() ![]() |
![]() ![]() 16.67% |
6 |
![]() ![]() ![]() |
![]() ![]() 16.67% |
6 |
![]() ![]() ![]() ![]() |
![]() ![]() 16.67% |
6 |
![]() ![]() ![]() ![]() ![]() |
![]() ![]() 16.67% |
6 |




16.67%

16.67%

16.67%

16.67%

16.67%