A
AMT2K5
Hello, I have a function that will so far convert an mp3 filename from
Track-Artist_moreartist.mp3
to Artist_moreartist_Track.mp3
*Where more artist is like Pink_Floyd not Queen*
I am getting weird results with my regular expression result
my @dir_contents = @_[0];
foreach(@dir_contents)
{
my $old = $_;
my $track;
my $artist;
my $fullTitle;
$old =~ m/-/;
$track = $`;
my $position = rindex($_ ,"-") + 1;
$artist = substr($_,$position);
$artist =~ s/\.mp3//;
$artist =~ s/^\s+//;
$artist =~ s/\s+$//;
$track =~ s/^\s+//;
$track =~ s/\s+$//;
$fullTitle = $artist."-".$track.".mp3";
return $fullTitle;
}
Original is Echoes-Derek_Duke.mp3
My result is (whitespace at the begining still)
\sDerek_Duke-Echoes.mp3 -.mp3
Appreciate any help whatsoever.
-Aaron
Track-Artist_moreartist.mp3
to Artist_moreartist_Track.mp3
*Where more artist is like Pink_Floyd not Queen*
I am getting weird results with my regular expression result
my @dir_contents = @_[0];
foreach(@dir_contents)
{
my $old = $_;
my $track;
my $artist;
my $fullTitle;
$old =~ m/-/;
$track = $`;
my $position = rindex($_ ,"-") + 1;
$artist = substr($_,$position);
$artist =~ s/\.mp3//;
$artist =~ s/^\s+//;
$artist =~ s/\s+$//;
$track =~ s/^\s+//;
$track =~ s/\s+$//;
$fullTitle = $artist."-".$track.".mp3";
return $fullTitle;
}
Original is Echoes-Derek_Duke.mp3
My result is (whitespace at the begining still)
\sDerek_Duke-Echoes.mp3 -.mp3
Appreciate any help whatsoever.
-Aaron