• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: counting lines
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: counting lines


  • Subject: Re: counting lines
  • From: Shane Stanley <email@hidden>
  • Date: Fri, 13 Jul 2001 08:40:50 +1000

On 13/7/01 5:07 AM +1000, Arthur Cormack, email@hidden, wrote:

> I am writing a script that uses bbEdit to open up a log file, and
> change the date formats of every entry in that log file. I am having
> a problem counting the number of lines in the logfile. The line that
> I use to calculate the number of lines goes like this:
> "set lineCount to the number of lines in text window 1"
> And it always seems to return a number that is 1 less that the number
> of lines.
> -I have noticed, however, that If I manually add a hard return after
> the last line (there wasn't one there before) then it works.
> Is there another perhaps another term that I should be using to
> calculate the number of lines in a text file?

I think you're doing the right thing; it looks like a bug to me. If you
have, say, five lines, count will return 4 but "line 5" and "line -1" both
return the last line.

--
Shane Stanley, email@hidden


References: 
 >counting lines (From: "Arthur Cormack" <email@hidden>)

  • Prev by Date: Re: Index of Handler
  • Next by Date: Applescripting logout in OS 9.1 Multiple Users
  • Previous by thread: counting lines
  • Next by thread: Re: counting lines
  • Index(es):
    • Date
    • Thread