File: Join.pl

package info (click to toggle)
ampliconnoise 1.29-10
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,040 kB
  • sloc: ansic: 18,080; sh: 2,899; perl: 2,089; makefile: 235
file content (34 lines) | stat: -rwxr-xr-x 495 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/perl
my $nK = 0;
my $count = 0;
my @lines = ();
foreach $file(@ARGV){
	open (FILE, $file) or die "Can't open $file\n";
	$line = <FILE>;
	if($count == 0){
		chomp($line);
		@tokens = split(/ /,$line);
		$nK = $tokens[1];
	}
	
	while($line = <FILE>){
		chomp($line);

		@tokens = split(/ /,$line);

		shift(@tokens);

		my $temp = "$count @tokens\n";
		push(@lines, $temp);
		$count++;
	}

	close(FILE);
}

print "$count $nK\n";

for($i = 0; $i < $count; $i++)
{
	print "$lines[$i]";
}