Re: Count lines
Re: Count lines
- Subject: Re: Count lines
- From: Chris Espinosa <email@hidden>
- Date: Fri, 12 Nov 2004 15:35:25 -0800
On Nov 12, 2004, at 2:04 PM, Paul Berkowitz wrote:
In this particular case, all I want is the number of lines, not the
file
name which wc -l adds on to the end. I guess you could remove that
with a
grep. Gnarlodius sent me:
do shell script "sed -n '$=' /SystemProfile.txt"
which works perfectly. (In fact it gives the answer "1" when there's a
Mac
file with no LFs. whereas wc -l says the answer is "0", which is
interesting.)
If you want to handle both Mac and Unix files, use tr:
cat ./SystemProfile.txt | tr \r \n | wc -l
Chris
_______________________________________________
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