Last change
on this file since 2811 was 1972, checked in by jmt14, 23 years ago |
* empty log message *
|
-
Property svn:executable
set to
*
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
393 bytes
|
Line | |
---|
1 | #!/usr/bin/perl -w
|
---|
2 |
|
---|
3 | # count-lines.pl - a quick script for counting
|
---|
4 | # the number of times each line appears in a file.
|
---|
5 | # Useful for building keyphrase-frequency files
|
---|
6 | # (see README for instructions).
|
---|
7 |
|
---|
8 | while (<>) {
|
---|
9 | chomp;
|
---|
10 | if ($_ =~ /./) {
|
---|
11 | s/\s/ /g;
|
---|
12 | $counter{$_}++;
|
---|
13 | } else {
|
---|
14 | $counter{"_blank_"}++;
|
---|
15 | }
|
---|
16 | }
|
---|
17 |
|
---|
18 | foreach $k (sort keys(%counter)) {
|
---|
19 | print "$k\t$counter{$k}\n";
|
---|
20 | }
|
---|
21 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.