Jun 13, 2003 #1 THEMAN101 Programmer Apr 29, 2003 44 US i have a text file that i want to get info from. How do i find how many lines are in the text file.
Jun 13, 2003 #2 TheBigBasicQ Programmer Dec 20, 2001 107 IN Simple... OPEN "TEXT1.TXT" FOR INPUT AS #1 DO LINE INPUT #1, A$ 'IF YOU DON'T WANT TO COUNT A BLANK LINE THEN UNREM THE 'CODE BELOW. 'IF LTRIM$(RTRIM$(A$))<>"" THEN C0UNT% = COUNT% + 1 'END IF LOOP UNTIL EOF(1) PRINT "NO. OF LINES IN THIS TEXT FILE IS " + LTRIM$(STR$(COUNT%)) CLOSE #1 Upvote 0 Downvote
Simple... OPEN "TEXT1.TXT" FOR INPUT AS #1 DO LINE INPUT #1, A$ 'IF YOU DON'T WANT TO COUNT A BLANK LINE THEN UNREM THE 'CODE BELOW. 'IF LTRIM$(RTRIM$(A$))<>"" THEN C0UNT% = COUNT% + 1 'END IF LOOP UNTIL EOF(1) PRINT "NO. OF LINES IN THIS TEXT FILE IS " + LTRIM$(STR$(COUNT%)) CLOSE #1