File: Truncate.pl

package info (click to toggle)
ampliconnoise 1.29-16
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,316 kB
  • sloc: ansic: 18,085; sh: 2,901; perl: 2,089; makefile: 240
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";
    }
}