From b24de062d156ae3f04773de55379e3277452f712 Mon Sep 17 00:00:00 2001 From: lshprung Date: Tue, 14 Sep 2021 16:31:30 -0700 Subject: Remove illegal characters for generating file name --- build_playlists.plx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build_playlists.plx b/build_playlists.plx index 3e43098..d860d7d 100755 --- a/build_playlists.plx +++ b/build_playlists.plx @@ -141,11 +141,15 @@ else { $tag_hash{$tags_of_interest[$j]} = $db_output[$j]; } + # TODO break up by semicolon (signifying array of tag values) # Determine output_file $output_file = $output_pattern; $output_file =~ s/[{]([^}]*)[}]/$tag_hash{$1}/g; - # TODO remove illegal filename characters + # remove illegal filename characters, replace them with underscore + $output_file =~ s/[\/<>:"\\|?*]/_/g; + print "$output_file\n"; + # Open the file for writing open FH, ">> $output_file" or die $!; # DEBUG -- cgit