From: Bruce Stephens on
Tony Houghton <h(a)realh.co.uk> writes:

[...]

> egrep -i '^[BCDGJOPQRSU]+$' your_scrabble_file
>
> etc
>
> I can't think of a trivial way to sort the results by word length.

No, though it feels like there ought to be an option to sort to do that.
Easiest is probably to use awk or perl, and then sort (or do the sort
inside either one). So

perl -n -e 'if (/^[BCDGJOPQRSU]+$/i) {printf "%d\t%s",length,$_;}' \
your_scrabble_file|sort -n
From: David Cowie on
Thanks everyone for the replies.

--
David Cowie http://www.flickr.com/photos/davidcowie/

Containment Failure + 57987:33
From: Simon Brooke on
On Sat, 26 Jun 2010 21:48:21 +0100, Paul Martin wrote:

> In article <88kphrF8u2U2(a)mid.individual.net>,
> Simon Brooke wrote:
>
>> Debian has an anagram generator called 'an' in the repository just now
>> - not one I've played with.
>
> It needs work. It generates loads of duplicates under certain
> circumstances.

| uniq

--

;; Semper in faecibus sumus, sole profundam variat

From: Simon Brooke on
On Sun, 27 Jun 2010 08:21:17 +0000, Simon Brooke wrote:

> On Sat, 26 Jun 2010 21:48:21 +0100, Paul Martin wrote:
>
>> It needs work. It generates loads of duplicates under certain
>> circumstances.
>
> | uniq

Or, actually, | sort | uniq

--

;; Semper in faecibus sumus, sole profundam variat

From: Jim A on
On 06/27/2010 10:28 AM, Simon Brooke wrote:
> On Sun, 27 Jun 2010 08:21:17 +0000, Simon Brooke wrote:
>
>> On Sat, 26 Jun 2010 21:48:21 +0100, Paul Martin wrote:
>>
>>> It needs work. It generates loads of duplicates under certain
>>> circumstances.
>>
>> | uniq
>
> Or, actually, | sort | uniq
>

Or, pedantically, | sort -u


--
www.slowbicyclemovement.org - enjoy the ride