File: Truncate.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 (16 lines) | stat: -rwxr-xr-x 225 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/perl

my $newLength = shift(@ARGV);

while($line = <STDIN>){
    chomp($line);

    if($line =~ />(.*)/){
	print "$line\n";
    }
    else{
	$truncate = substr($line, 0, $newLength);

	print "$truncate\n";
    }
}