• 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: Count lines in a textfile
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Count lines in a textfile


  • Subject: Re: Count lines in a textfile
  • From: Paul Berkowitz <email@hidden>
  • Date: Thu, 16 Sep 2004 18:02:17 -0700

Title: Re: Count lines in a textfile
On 9/16/04 5:54 PM, "Gnarlodious" <email@hidden> wrote:

Entity Stefan Eriksson spoke thus:

> 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 ?

set filePath to POSIX path of (choose file)
do shell script "cat " & the quoted form of filePath & " | tr '\\r' '\\n' | sed -n '$=' "

What's wrong with paragraphs, as others have suggested? Why go through all that palaver?

--
Paul Berkowitz
 _______________________________________________
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

  • Follow-Ups:
    • Re: Count lines in a textfile
      • From: Gnarlodious <email@hidden>
References: 
 >Re: Count lines in a textfile (From: Gnarlodious <email@hidden>)

  • Prev by Date: Re: Count lines in a textfile
  • Next by Date: Re: Count lines in a textfile
  • Previous by thread: Re: Count lines in a textfile
  • Next by thread: Re: Count lines in a textfile
  • Index(es):
    • Date
    • Thread