Re: Count lines in a textfile
Re: Count lines in a textfile
- Subject: Re: Count lines in a textfile
- From: Michelle Steiner <email@hidden>
- Date: Thu, 16 Sep 2004 17:03:44 -0700
On Sep 16, 2004, at 4:02 PM, Stefan Eriksson wrote:
Anyone got a tip on how to count number of lines in a text-document,
i´ve been testing to read how many ASCII Character 10/13 there are in
a text-file but can´t get some accurate figures out of it... any ideas
?
How do you define a line? There really is no such thing in text, so
far as Applescript is concerned; there are characters, words, and
paragraphs. Some applications may define more text entities in their
dictionaries, though.
If a line is considered to be the same as a paragraph, then this will
do it:
count paragraphs of the_text
Or will it? If there is double spacing between paragraphs, then that
code will return approximately double the number of actual paragraphs
because each blank line will be counted as a paragraph.
So before you can count the "lines" of a text file, you have to define
"line."
-- Michelle
--
In theory, theory and practice are the same.
In practice, they're not. --Yogi Berra
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden