Results 1 to 10 of 10

Thread: ?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User toc's Avatar
    Join Date: Mar:2006
    Location:
    Posts: 448

    ?

    ? ... .

  2. #2
    Deleted User 4eRNoBiL's Avatar
    Join Date: Oct:2005
    Location:
    Posts: 739
    , " " "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

  3. #3
    Registered User toc's Avatar
    Join Date: Mar:2006
    Location:
    Posts: 448
    Quote Originally Posted by 4eRNoBiL
    , " " "nqkakyv tekst", ? Shtirlitz, , "" . - A=A, =G, =6 ( - , ) .. , .
    - ".doc" "primer.doc". ... .

  4. #4
    Banned
    Join Date: Oct:2001
    Location: , -5
    Posts: 2,637
    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($_);
     }
    }
    Perl, .
    Last edited by exabyte; 8th October 2006 at 16:01. Reason: Windows,

  5. #5
    ' ... goblin's Avatar
    Join Date: Apr:2005
    Location: Bg
    Posts: 1,402

  6. #6
    . 's Avatar
    Join Date: Feb:2006
    Location: .
    Posts: 2,737
    .
    , .
    ?
    - .

  7. #7
    Registered User toc's Avatar
    Join Date: Mar:2006
    Location:
    Posts: 448
    Quote Originally Posted by exabyte
    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($_);
     }
    }
    Perl, .
    exabyte, ,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |