Advertisement
ZaxonXP45

frename.pl - skrypt do zmiany nazw zdjęć pobranych z fotoforum.gazeta.pl

Apr 15th, 2022
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.46 KB | None | 0 0
  1. #!/usr/bin/perl
  2. $| = 1;
  3.  
  4. use warnings;
  5. use strict;
  6.  
  7. foreach (qx/exiftool -FileName -CreateDate -T *.jpg/) {
  8.     next if (/\t-/);
  9.     next if (/\d{4}-\d{2}-\d{2}.*/);
  10.     s/:/-/g;
  11.     s/(.+)\t(.+) (.+)/mv -n "$1" "$2_$3.jpg"/;
  12.     print;
  13. }
  14.  
  15. foreach (qx/exiftool -FileName -FileModifyDate -T *.jpg/) {
  16.     next if (/\t-/);
  17.     next if (/\d{4}-\d{2}-\d{2}.*/);
  18.     s/\+\d{2}:\d{2}//;
  19.     s/:/-/g;
  20.     s/(.+)\t(.+) (.+)/mv -n "$1" "$2_$3.jpg"/;
  21.     print;
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement