Results 1 to 10 of 10
Thread: ?
Hybrid View
-
7th October 2006 22:03 #1
-
8th October 2006 11:35 #2
, " " "nqkakyv tekst", ? Shtirlitz, , "" . - A=A, =G, =6 ( - ,
) .. , .
Fujistu Lifebook E756 | Core i7-6500U / 400MHz-3.1GHz | 8 GB DDR4-2133 | Samsung PM871 / 256 GB SSD | 15" 1920x1080 | Manjaro Linux + kernel 4.19
-
8th October 2006 14:41 #3- ".doc" "primer.doc". ... .
Originally Posted by 4eRNoBiL
-
8th October 2006 15:33 #4Banned
Join Date: Oct:2001
Location: , -5
Posts: 2,637
Perl, .Code:#!/usr/bin/perl # Cyrillic-to-Latin Autorenamer # # Copyright (C) 2006 # Milko Krasnomirov Krachounov # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA #: #perl rename.pl [-R] <dir1> <dir2> ... use utf8; use encoding "utf8"; use strict; # , my @table = ( "a", "b", "v", "g", "d", "e", "j", "z", "i", "y", "k", "l", "m", "n", "o", "p", "r", "s", "t", "u", "f", "h", "c", "ch", "sh", "sht", "y", "j", "_", "_", "yu", "q"); my $recursive = 0; sub convert($) { my $result = ""; my $len = length($_[0]); for (my $i = 0; $i < $len; $i++) { my $chr = ord(substr($_[0],$i,1)); if ($chr > 1071 && $chr < 1104) { $result .= $table[$chr-1072]; } elsif ($chr > 1039 && $chr < 1072) { $result .= uc($table[$chr-1040]); } else { $result .= substr($_[0],$i,1); } } return $result; } sub fixdir($) { my $dir = $_[0]; my $DIR; opendir($DIR,$dir); while (my $file = readdir($DIR)) { if ($file =~ /^\.{1,2}$/) { next; } if ( ! -l "$dir/$file" && -d "$dir/$file" && $recursive ) { fixdir("$dir/$file"); } utf8::upgrade($file); my $newname = convert($file); if ($newname ne $file) { print("$dir: File will be renamed to $newname, continue? "); my $go = <STDIN>; chomp $go; if ($go =~ /^y/i) { rename ("$dir/$file" , "$dir/$newname" ); } } } } my $param = 1; for (@ARGV) { if (/^-r$/i) { $recursive = 1; } elsif (/^--$/) { $param = 0; } elsif (!/^-/ || !$param) { fixdir($_); } }Last edited by exabyte; 8th October 2006 at 16:01. Reason: Windows,
-
8th October 2006 16:07 #5
-
8th October 2006 20:04 #6
-
8th October 2006 23:32 #7




Reply With Quote
7th May 2023, 16:02 in PC