Forum » Zvok in slika » Program za preimenovanje slik
Program za preimenovanje slik
vratar ::
Zanima me, če obstaja kak enostaven program za preimenovanje slik? Sedaj so slike označene z DSC00123 jaz pa bi to rad naredu svoj opis slike.
milc ::
Jaz mam sicer sprogramiran program, ki mi naredi še direktorij glede na datum slikanja.
Lahko si pomagaš s tem: http://www.microsoft.com/windowsxp/usin...
Moj programček, star, zelo star (skopiraj v file recimo move2dirs.pl) daj v isti direktorij, kjer imaš slike, instaliraj perl (recimo http://www.activestate.com/)
Lahko si pomagaš s tem: http://www.microsoft.com/windowsxp/usin...
Moj programček, star, zelo star (skopiraj v file recimo move2dirs.pl) daj v isti direktorij, kjer imaš slike, instaliraj perl (recimo http://www.activestate.com/)
#!/usr/bin/perl # # Move the files into directories based on modification date of the file # use strict; use warnings; use File::stat; use File::Copy; my $dir = '.'; print "Start:\n"; opendir(DIR, $dir) or die $!; my $i=0; my @FILES; while (my $file = readdir(DIR)) { # Use a regular expression to ignore files beginning with a period next if ($file =~ m/^\./); next unless (-f "$dir/$file"); next if ($file =~m/move2dirs/); # ignore the perl script - this file $FILES[$i++] = "$file"; print "$i > $file\n"; } closedir(DIR); my $filename; my $sb; my $targetdir; my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks); my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst); foreach $filename (sort @FILES) { # print "$filename .."; # ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, # $atime,$mtime,$ctime,$blksize,$blocks) # = stat($filename); $sb = stat("$dir/$filename"); printf "File is %s, size is %s, perm %04o, mtime %s ...", $filename, $sb->size, $sb->mode & 07777, scalar localtime $sb->mtime; # 0 1 2 3 4 5 6 7 8 ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($sb->mtime); $year+=1900; $mon++; $mon = sprintf( "%02d", $mon); $mday = sprintf( "%02d", $mday); $targetdir = $year . "_" . $mon . "_" . $mday; print "Modified: $targetdir\n"; mkdir "$dir/$targetdir" if(!-d "$dir/$targetdir"); # Create a dir using the name of the target dir move("$dir/$filename", "$dir/$targetdir/$filename") or die "move failed: $!"; # Moving file }
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | upload zip datotek (slike)Oddelek: Izdelava spletišč | 1200 (986) | Veron |
» | php $_FILE in praviceOddelek: Izdelava spletišč | 721 (648) | psychoP |
» | PHP problem z direktorijamiOddelek: Izdelava spletišč | 873 (769) | rokpok |
» | preimenovanje 700 slik naenkratOddelek: Programska oprema | 1962 (1711) | Mercier |
» | Program ki extract-a filename in ga prilepi v tabelo...Oddelek: Programska oprema | 1106 (1058) | 2tiLen |