Re: Count lines in a textfile
Re: Count lines in a textfile
- Subject: Re: Count lines in a textfile
- From: Christopher Nebel <email@hidden>
- Date: Thu, 16 Sep 2004 18:07:20 -0700
On Sep 16, 2004, at 5:54 PM, Gnarlodious 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 '$=' "
"sed -n '$='" is equivalent to "wc -l".
--Chris Nebel
AppleScript Engineering _______________________________________________
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