Counting lines in text files
Advertisements
| Top Tutorials | New Tutorials | Submit | Login | Register |
Tutorial 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: 2927
Total Votes: 36 votes
Category: ASP/File Manipulation
Submitted on: 2008-03-06 09:59:19
Submitted By: Devesh Khanna
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.")
%> More detail...
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%