--- /dev/null
+#!/usr/bin/perl
+
+#
+# Removes insertions (represented by "-" or ".") from FASTA files
+#
+
+use strict;
+use warnings;
+
+if ($ARGV[0]) { open(FILE, "<$ARGV[0]") or die($!); }
+else { open(FILE, "<-") or die($!); }
+
+my $seq;
+
+while (<FILE>) {
+ if (! /^>/) {
+ s/-|\.|\n//g;
+ $seq .= $_;
+ }
+ else { # If there's a sequence print it
+ if ($seq) { $seq =~ s/(.{72})/$1\n/g; print "$seq\n"; }
+ print $_; # Then the title
+ $seq = "";
+ }
+ }
+if ($seq) { $seq =~ s/(.{72})/$1\n/g; print "$seq\n"; }