Move old scripts into a subdir
This commit is contained in:
parent
b9a82c6e33
commit
6b49d958d8
7 changed files with 0 additions and 0 deletions
23
misc/collapse
Executable file
23
misc/collapse
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
|
||||
my ( $key, @values ) = next_record();
|
||||
|
||||
while ( defined $key ) {
|
||||
my ( $next_key, @next_values ) = next_record();
|
||||
if ( defined $next_key and $next_key eq $key ) {
|
||||
push @values, @next_values;
|
||||
}
|
||||
else {
|
||||
print join( "\t", $key, @values ) . "\n";
|
||||
$key = $next_key;
|
||||
@values = @next_values;
|
||||
}
|
||||
}
|
||||
|
||||
sub next_record {
|
||||
defined( local $_ = <> ) or return;
|
||||
chomp; split;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue