#!/usr/bin/perl -w # Cleans nonstandard characters that adsense puts in CSV files so # that they can be imported to Excel, Mathematica, etc... use strict; while (<>){ # turn at least two spaces into a tab $_ =~ s/\s{2,}/\t/g; # delete anything funky that adsense puts in the csv file $_ =~ s/[^A-Za-z0-9\s\t.%-]+//g; print $_ ; }