Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vbs to line count a text file

Status
Not open for further replies.

sumgirl

IS-IT--Management
Mar 19, 2003
55
US
Can anyone tell me how (or point me to how) count the number of lines in a text file?
 
Hello again,

This may turn really urgly, no esthetic, plain mondaine.
Code:
for i=0 to ubound(acontents)-1
    ofile.writeline acontents(i)
next
ofile.write acontents(ubound(acontents))
'continue here
- tsuji
 
In the meanwhile, I spoke to a friend who suggested:

if acontents(ubound(acontents)) = "" then
redim preserve acontents(ubound(acontents) - 1)
end if

and that seems to work ok - only that's working on any empty lines within the data I think?

Will try your solution ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top