in reply to find acronyms in a text
#!/usr/bin/perl -w use strict; my %acronyms_captured; my $file = 'test.txt'; open FH, "<", $file or die; while(<FH>){ my @words = $_ =~ m/\b[A-Z]+\b/g; foreach(@words) { $acronyms_captured{$_} = undef; } } close(FH); foreach(keys(%acronyms_captured)){ print "$_\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: find acronyms in a text
by davorg (Chancellor) on Jul 23, 2009 at 14:59 UTC | |
by arun_kom (Monk) on Jul 23, 2009 at 15:46 UTC | |
Re^2: find acronyms in a text
by steph_bow (Pilgrim) on Jul 23, 2009 at 14:44 UTC | |
by arun_kom (Monk) on Jul 23, 2009 at 22:32 UTC |