- - -
: | .
UoKit.com > > UO Pilot
: 1, 2
FREEON
?
test.txt, , ( ).
1,2,3,4,5,11,27

1 , 2 . .
, :
qwerty : Hfcrkflrf ->

. , , . .
:
$GfHjKm$_Dfvgbh >>> ;;_


--lua
--
-- Hfcrkflrf ->
local file= io.open([[C:\123.txt]], "r")          --
local result_file = io.open([[C:\456.txt]], "w")  --

local t={}
t["a"]=""  t["b"]=""  t["c"]=""  t["d"]=""  t["e"]=""  t["f"]=""
t["g"]=""  t["h"]=""  t["i"]=""  t["j"]=""  t["k"]=""  t["l"]=""
t["m"]=""  t["n"]=""  t["o"]=""  t["p"]=""  t["q"]=""  t["r"]=""
t["s"]=""  t["t"]=""  t["u"]=""  t["v"]=""  t["w"]=""  t["x"]=""
t["y"]=""  t["z"]=""  t["`"]=""  t["["]=""  t["]"]=""  t[";"]=""
t["'"]=""  t[","]=""  t["."]=""  t["/"]="."  t["A"]=""  t["B"]=""
t["C"]=""  t["D"]=""  t["E"]=""  t["F"]=""  t["G"]=""  t["H"]=""
t["I"]=""  t["J"]=""  t["K"]=""  t["L"]=""  t["M"]=""  t["N"]=""
t["O"]=""  t["P"]=""  t["Q"]=""  t["R"]=""  t["S"]=""  t["T"]=""
t["U"]=""  t["V"]=""  t["W"]=""  t["X"]=""  t["Y"]=""  t["Z"]=""
t["{"]=""  t["}"]=""  t[":"]=""  t['"']=""  t["<"]=""  t[">"]=""
t["?"]=","  t["~"]=""  t["@"]='"'  t["#"]=""  t["$"]=";"  t["^"]=":"
t["&"]="?"

if file and result_file then     --
    for v in file:lines() do
        result_file:write(string.gsub(v, ".", t).."\r\n")  -- 't'
    end

    file:close()
    result_file:close()
else
    log (" /")
end

URL-decoder(): %D0%A2%D0%B5%D0%BA%D1%81%D1%82 ->

URL () . URL US-ASCII. , , . . , , , .
:
%D0%9A%D1%83%D0%BF%D0%B8%D1%82%D1%8C >>>


--lua
log "clear"   log "mode compact"

local s=" URL"   -- << url- ""
log(s)

local t={}
t["%D0%90"]="" t["%D0%91"]="" t["%D0%92"]="" t["%D0%93"]="" t["%D0%94"]="" t["%D0%95"]="" t["%D0%81"]="" t["%D0%96"]="" t["%D0%97"]="" t["%D0%98"]="" t["%D0%99"]=""
t["%D0%9A"]="" t["%D0%9B"]="" t["%D0%9C"]="" t["%D0%9D"]="" t["%D0%9E"]="" t["%D0%9F"]="" t["%D0%A0"]="" t["%D0%A1"]="" t["%D0%A2"]="" t["%D0%A3"]="" t["%D0%A4"]=""
t["%D0%A5"]="" t["%D0%A6"]="" t["%D0%A7"]="" t["%D0%A8"]="" t["%D0%A9"]="" t["%D0%AA"]="" t["%D0%AB"]="" t["%D0%AC"]="" t["%D0%AD"]="" t["%D0%AE"]="" t["%D0%AF"]=""
t["%D0%B0"]="" t["%D0%B1"]="" t["%D0%B2"]="" t["%D0%B3"]="" t["%D0%B4"]="" t["%D0%B5"]="" t["%D1%91"]="" t["%D0%B6"]="" t["%D0%B7"]="" t["%D0%B8"]="" t["%D0%B9"]=""
t["%D0%BA"]="" t["%D0%BB"]="" t["%D0%BC"]="" t["%D0%BD"]="" t["%D0%BE"]="" t["%D0%BF"]="" t["%D1%80"]="" t["%D1%81"]="" t["%D1%82"]="" t["%D1%83"]="" t["%D1%84"]=""
t["%D1%85"]="" t["%D1%86"]="" t["%D1%87"]="" t["%D1%88"]="" t["%D1%89"]="" t["%D1%8A"]="" t["%D1%8B"]="" t["%D1%8C"]="" t["%D1%8D"]="" t["%D1%8E"]="" t["%D1%8F"]=""

for v in pairs(t) do   -- , "%D0%9A", "%d0%9a"
    t[v:lower()]=t[v]
end

for i=32, 127 do t["%" .. string.format("%X", i)]=string.char(i) end   -- , ascii 32 127

s=s:gsub("%%[Dd][01]%%%x%x", t)   --
s=s:gsub("%%..", t)               --
log(s)                            --

. Reverser : . -> .

, , . ... smile.gif
.
:
! >>> !


--lua
log "clear"  log "mode compact"
local s=" ."
log (s)
log (s:reverse())

: Morse to text -> -- --- .-. ... . - --- - . -..- -

, , , , .
. :
Text <<->> - . -..- -


--lua
log "clear"  log "mode compact"
-- () .
local text=[[Text or - . -..- -]]-- << .

log(text)

local t, t1, temp = {}, {}, {}
t["A"]=".-"     t["B"]="-..."   t["C"]="-.-."   t["D"]="-.."    t["E"]="."      t["F"]="..-."   t["G"]="--."
t["H"]="...."   t["I"]=".."     t["J"]=".---"   t["K"]="-.-"    t["L"]=".-.."   t["M"]="--"     t["N"]="-."
t["O"]="---"    t["P"]=".--."   t["Q"]="--.-"   t["R"]=".-."    t["S"]="..."    t["T"]="-"      t["U"]="..-"
t["V"]="...-"   t["W"]=".--"    t["X"]="-..-"   t["Y"]="-.--"   t["Z"]="--.."
for v in pairs(t) do temp[string_lower(v)]=t[v] end
for v in pairs(temp) do t[v]=temp[v] end
t["1"]=".----"  t["2"]="..---"  t["3"]="...--"  t["4"]="....-"  t["5"]="....."  t["6"]="-...."  t["7"]="--..."
t["8"]="---.."  t["9"]="----."  t["0"]="-----"  t["."]="......" t[":"]="---..." t[";"]="-.-.-." t["("]="-.--.-"
t[")"]="-.--.-" t["'"]=".----." t['"']=".-..-." t["-"]="-....-" t["/"]="-..-."  t["?"]="..--.." t["!"]="--..--"
t[","]=".-.-.-"
for v in pairs(t) do t1[t[v]]=v end   -- , 't'

local x=0
for v in text:gmatch("[%.%- ]") do x=x+1 end  -- ,

if x > #text*50/100 then   -- 50%,
    text=string.gsub((text .. " "):gsub("(.-) ", t1), "  ", " ")    --
else
    text=string.gsub(text:gsub("(.)", "%1 "), "[^ ]", t)  --
end
log (text)

. :
<<->> - . -.- ... -


--lua
log "clear"  log "mode compact"

-- () .
local text=[[ - . -.- ... -]]-- << .

log(text)

local t, t1, temp = {}, {}, {}
t[""]=".-"     t[""]="-..."   t[""]=".--"    t[""]="--."    t[""]="-.."    t[""]="."    t[""]="."
t[""]="...-"   t[""]="--.."   t[""]=".."     t[""]=".---"   t[""]="-.-"    t[""]=".-.." t[""]="--"
t[""]="-."     t[""]="---"    t[""]=".--."   t[""]=".-."    t[""]="..."    t[""]="-"    t[""]="..-"
t[""]="..-."   t[""]="...."   t[""]="-.-."   t[""]="---."   t[""]="----"   t[""]="--.-" t[""]="-..-"
t[""]="-..-"   t[""]="-.--"   t[""]="..-.."  t[""]="..--"   t[""]=".-.-"
for v in pairs(t) do temp[string_lower(v)]=t[v] end
for v in pairs(temp) do t[v]=temp[v] end
t["1"]=".----"  t["2"]="..---"  t["3"]="...--"  t["4"]="....-"  t["5"]="....."  t["6"]="-...."  t["7"]="--..."
t["8"]="---.."  t["9"]="----."  t["0"]="-----"  t["."]="......" t[":"]="---..." t[";"]="-.-.-." t["("]="-.--.-"
t[")"]="-.--.-" t["'"]=".----." t['"']=".-..-." t["-"]="-....-" t["/"]="-..-."  t["?"]="..--.." t["!"]="--..--"
t[","]=".-.-.-"
for v in pairs(t) do t1[t[v]]=v end   -- , 't'

local x=0
for v in text:gmatch("[%.%- ]") do x=x+1 end  -- ,

if x > #text*50/100 then   -- 50%,
    text=string.gsub((text .. " "):gsub("(.-) ", t1), "  ", " ")    --
else
    text=string.gsub(text:gsub("(.)", "%1 "), "[^ ]", t)  --
end
log (text)


cirus .
cirus
--lua
local file= io.open([[C:\123.txt]], "r")          --
local result_file = io.open([[C:\456.txt]], "w")  --

local t={}
t["1"]=""          -- '1' ''
t["2"]=""          -- '2' ''
t["11"]=" "

if file and result_file then     --
    for v in file:lines() do
        result_file:write(string.gsub(v, "[^,]+", t).."\r\n")  -- 't'
    end

    file:close()
    result_file:close()
else
    log (" /")
end
NoName212
php )



3.0(2012 ! :/ ) , (). , , , , - , . F5. test.txt, . 0 => 'string' .

c("label1")->text;
$find_and_repeat = array (
'0' => '',
'1' => ' ',
'23' => ' ',
'45' => ' ',
);
$test = 'test.txt';
$test = file_get_contents($test);
$test = explode (',', $test); // , - !
foreach ($find_and_repeat as $key => $v)
{
    $test = str_replace($key, $v, $test);
    $newTest = fopen('new_test.txt', 'w');
    $check = fwrite($newTest , implode($test));
    fclose($newTest);
}
//print_r($test);
if($check = true)
{echo '!!!';}
FREEON
(cirus @ 27.1.2019, 11:44) *

--lua
local file= io.open([[C:\123.txt]], "r")          --
local result_file = io.open([[C:\456.txt]], "w")  --

local t={}
t["1"]=""          -- '1' ''
t["2"]=""          -- '2' ''
t["11"]=" "

if file and result_file then     --
    for v in file:lines() do
        result_file:write(string.gsub(v, "[^,]+", t).."\r\n")  -- 't'
    end

    file:close()
    result_file:close()
else
    log (" /")
end


, qwerty - q =
:
.- =
-... =
.-- =
DarkMaster
, qwerty - q =

:
t["1"]="" -- '1' ''
t["2"]="" -- '2' ''
t["11"]=" "

cirus
:

, . , .
qwerty

--lua
local file= io.open([[C:\123.txt]], "r")          --
local result_file = io.open([[C:\456.txt]], "w")  --

local t={}
t["q"]=""          -- 'q' ''
t["w"]=""          
t["e"]=""
t["r-"]=""

if file and result_file then     --
    for v in file:lines() do
        result_file:write(string.gsub(v, ".", t).."\r\n")  -- 't'
    end

    file:close()
    result_file:close()
else
    log (" /")
end

:

. ?
.- = - 2
-... = - 4
.--... - , .--
1 .
FREEON
(DarkMaster @ 27.1.2019, 13:28) *

:


t["q"]=""          -- ''
t["w."]=""          -- '2' ''
t["e"]=""
t["t"]=""
t["y"]=""

:

qwetty
qwerrrty q
ytreq
ytrewq

:

qwetty
qwerrrty q
ytreq
ytrewq
huh.gif

(cirus @ 27.1.2019, 13:38) *

, . , .

.gsub(v, ".", t).."\r\n")  --       't'


? ? ?
cirus
.gsub(v, ".", t).."\r\n")
?

, , .
?

. 'lua '.

"." - , , "..." - 3
"[^,]+" - , 1
FREEON
(cirus @ 27.1.2019, 13:38) *

. ?
.- = - 2
-... = - 4
.--... - , .--
1 .

, .

, , !



-- , : "" 1
"" ( )
: 0
, ,

php


<?php
/**
* Created by PhpStorm.
* User: karamush
* Date: 13.07.2018
* Time: 23:08
*/

class MorseCoder_Class {

    public $MORSE_CHAR_DELIMITER = ' ';            //
    public $UNKNOWN_CHAR = '?';                    // .
    public $MORSE_DOT = '.';                       //
    public $MORSE_DASH = '-';                      //
    public $MORSE_BIN_DOT = '1';                   //
    public $MORSE_BIN_DASH ='111';                 //
    public $MORSE_BIN_DELIMITER = '0';             //
    public $MORSE_BIN_CHAR_DELIMITER = '00';       //
    public $MORSE_BIN_WORD_DELIMITER = '000';      // (. ?)

    const MORSE_TYPE_SIMPLE = 0;
    const MORSE_TYPE_BINARY = 1;
    const MORSE_LANGUAGE_LATIN = 1;
    const MORSE_LANGUAGE_CYRILLIC = 0;

    public $morse_type = self::MORSE_TYPE_BINARY;
    public $morse_language = self::MORSE_LANGUAGE_CYRILLIC;
    public $morse_capital = true;

    //
    private $codes_symbols = [
        '1' => '.----',
        '2' => '..---',
        '3' => '...--',
        '4' => '....-',
        '5' => '.....',
        '6' => '-....',
        '7' => '--...',
        '8' => '---..',
        '9' => '----.',
        '0' => '-----',
        '.' => '......',
        ',' => '.-.-.-',
        ':' => '---...',
        ';' => '-.-.-.',
        '(' => '-.--.-',
        ')' => '-.--..', // TODO: . :)
        '\'' => '.----.',
        '`' => '.----.',
        '"' => '.-..-.',
        '-' => '-....-',
        '/' => '-..-.',
        '?' => '..--..',
        '!' => '--..--',
        ' ' => '-...-', // , , , WTF?!
        "\n" => '-.-..',    // TODO: . !
        "\r" => '-.-..-',   // TODO: --!
        '@' => '.--.-.',
        '[END]' => '..-.-'
    ];

    //
    private $codes_latin = [
        'A' => '.-',
        'B' => '-...',
        'C' => '-.-.',
        'D' => '-..',
        'E' => '.',
        'F' => '..-.',
        'G' => '--.',
        'H' => '....',
        'I' => '..',
        'J' => '.---',
        'K' => '-.-',
        'L' => '.-..',
        'M' => '--',
        'N' => '-.',
        'O' => '---',
        'P' => '.--.',
        'Q' => '--.-',
        'R' => '.-.',
        'S' => '...',
        'T' => '-',
        'U' => '..-',
        'W' => '.--',
        'X' => '-..-',
        'Y' => '-.--',
        'Z' => '--..',
        'V' => '...-',
        'CH' => '---.',
        'SH' => '----',
        'Ñ' => '-..-',
        'É' => '..-..',
        'Ü' => '..--',
        'Ä' => '.-.-'
    ];

    //
    private $codes_cyrillic = [
        '' => '.-',
        '' => '-...',
        '' => '.--',
        '' => '--.',
        '' => '-..',
        '' => '.',     '' => '.',
        '' => '...-',
        '' => '--..',
        '' => '..',
        '' => '.---',
        '' => '-.-',
        '' => '.-..',
        '' => '--',
        '' => '-.',
        '' => '---',
        '' => '.--.',
        '' => '.-.',
        '' => '...',
        '' => '-',
        '' => '..-',
        '' => '..-.',
        '' => '....',
        '' => '-.-.',
        '' => '---.',
        '' => '----',
        '' => '--.-',
        '' => '-..-',  '' => '-..-',
        '' => '-.--',
        '' => '..-..',
        '' => '..--',
        '' => '.-.-',
    ];

    public function __construct() {

    }

    /**
     * , ,
     * ,
     * . .
     *
     * @return array
     */
    private function get_current_full_alphabet() {
        $alphabet = ($this->morse_language == self::MORSE_LANGUAGE_CYRILLIC) ? array_merge($this->codes_cyrillic, $this->codes_latin) : array_merge($this->codes_latin, $this->codes_cyrillic);
        return array_merge($alphabet, $this->codes_symbols);
    }

    /**
     * -
     * @param $char
     *
     * @return mixed|string
     */
    function char_to_morse($char) {
        $char = mb_strtoupper($char);
        return array_key_exists($char, $this->get_current_full_alphabet()) ? $this->get_current_full_alphabet()[$char] : $this->UNKNOWN_CHAR;
    }

    /**
     * , ..
     * @param $morse_text
     *
     * @return string
     */
    function prepare_morse_text($morse_text) {
        $morse_text = str_replace('*', '.', $morse_text);
        $morse_text = str_replace('_', '-', $morse_text);
        return $morse_text;
    }

    function mbStringToArray($string, $encoding = 'UTF-8') {
        $strlen = mb_strlen($string);
        $str_array = [];
        while ($strlen) {
            $str_array[] = mb_substr($string, 0, 1, $encoding);
            $string = mb_substr($string, 1, $strlen, $encoding);
            $strlen = mb_strlen($string, $encoding);
        }
        return $str_array;
    }

    /**
     * -
     * @param $morse_char
     *
     * @return string
     */
    function morse_to_char($morse_char) {
        //
        $morse_char = $this->prepare_morse_text($morse_char);
        return in_array($morse_char, $this->get_current_full_alphabet()) ? array_search($morse_char, $this->get_current_full_alphabet()) : $this->UNKNOWN_CHAR;
    }

    /**
     * , .
     * @param $plain_text
     *
     * @return string
     */
    function text_to_morse($plain_text) {
        $plain_text = $this->mbStringToArray(mb_strtoupper($plain_text));
        $result = '';
        foreach ($plain_text as $char) {
            $result .= $this->char_to_morse($char) . $this->MORSE_CHAR_DELIMITER;
        }
        return $result;
    }

    /**
     * .
     *
     * @param      $morse_text
     *
     * @return string
     */
    function morse_to_text($morse_text) {
        $morse_chars = explode($this->MORSE_CHAR_DELIMITER, $morse_text);
        $result = '';
        foreach($morse_chars as $char) {
            $result .= $this->morse_to_char($char);
        }

        return $this->morse_capital ? $result : mb_strtolower($result);
    }

    /**
     * .
     * @param $morse_bin_text
     *
     * @return string
     */
    function morse_bin_to_morse($morse_bin_text) {
        $result = '';
        $bin_morse_chars = explode($this->MORSE_BIN_CHAR_DELIMITER, $morse_bin_text);
        foreach ($bin_morse_chars as $bin_morse_char) {
            $bin_morse_char = str_replace($this->MORSE_BIN_DASH, $this->MORSE_DASH, $bin_morse_char);
            $bin_morse_char = str_replace($this->MORSE_BIN_DOT, $this->MORSE_DOT, $bin_morse_char);
            $bin_morse_char = str_replace($this->MORSE_BIN_DELIMITER, '', $bin_morse_char);
            $result .= $bin_morse_char . $this->MORSE_CHAR_DELIMITER;
        }
        return rtrim($result, $this->MORSE_CHAR_DELIMITER);
    }

    /**
     * .
     * @param $morse_text
     *
     * @return string
     */
    function morse_to_morse_bin($morse_text) {
        $result = '';
        $morse_text = $this->prepare_morse_text($morse_text);
        for($i=0; $i<strlen($morse_text);$i++) {
            switch ($morse_text[$i]) {
                case $this->MORSE_DOT: $result .= $this->MORSE_BIN_DOT . $this->MORSE_BIN_DELIMITER; break;
                case $this->MORSE_DASH: $result .= $this->MORSE_BIN_DASH . $this->MORSE_BIN_DELIMITER; break;
                case $this->MORSE_CHAR_DELIMITER: $result .= $this->MORSE_BIN_DELIMITER; break; // , .
            }
        }
        return $result;
    }

    /**
     *
     * @param $plaint_text
     *
     * @return string
     */
    function text_to_morse_bin($plaint_text) {
        return $this->morse_to_morse_bin($this->text_to_morse($plaint_text));
    }

    /**
     *
     *
     * @param      $morse_bin
     *
     * @return string
     */
    function morse_bin_to_text($morse_bin) {
        return $this->morse_to_text($this->morse_bin_to_morse($morse_bin));
    }

    /**
     *
     * ( morse_type)
     * @param $plain_text
     *
     * @return string
     */
    function morse_encode($plain_text) {
        return ($this->morse_type == self::MORSE_TYPE_BINARY) ? $this->text_to_morse_bin($plain_text) : $this->text_to_morse($plain_text);
    }

    /**
     *
     * ( morse_type)
     * @param $encoded_text
     *
     * @return string
     */
    function morse_decode($encoded_text) {
        return ($this->morse_type == self::MORSE_TYPE_BINARY) ? $this->morse_bin_to_text($encoded_text) : $this->morse_to_text($encoded_text);
    }


}

FREEON
... ( )? ( ).
cirus
--lua
log "clear"  log "mode compact"
local t={}  --
t[".-"]="A"
t["-..."]="B"
t["-.-."]="C"

local x="ACDBA"   -- , 'D' ,
log(" :\r\n" .. x)
log()

-- :
--    A           B             C               --
--    .-00        -...00        -.-.00          -- 00
--    .0-00       -0.0.0.00     -0.0-0.00       -- 0
--    10-00       -01010100     -010-0100       -- 1
--    1011100     11101010100   1110101110100   -- 111

local s=""
for w in x:gmatch(".") do         --
    local break_=0
    for i, value in pairs(t) do   --
        if value == w then        --
            s=s .. string.gsub(string.gsub(string.gsub(i, "(.)", "%10") .. "0", "%.", "1"), "%-", "111")  -- , 'A' 1011100
            break_ = 1    --
            break
        end
    end
    if break_ == 0 then s=s .. w .. "00" end   -- , , . .
end
log (" :\r\n" .. s)   --
log()

local ss=""
for w in s:gmatch("(.-)00") do  -- , 00
    if w:match("[01]+") then    --
       ss=ss .. string.gsub(string.gsub(string.gsub(w:gsub("111", "-"), "1", "."), "0", ""), ".+", t)
    else
       ss=ss .. w   -- ,
    end
end
log (" :\r\n" .. ss)

( )? ( ).

. http://uopilot.tati.pro/index.php?title=Clipboard_(Lua)
FREEON
(cirus @ 27.1.2019, 16:25) *

--lua
log "clear"  log "mode compact"
local t={}  --
t[".-"]="A"
t["-..."]="B"
t["-.-."]="C"

local x="ACDBA"   -- , 'D' ,
log(" :\r\n" .. x)
log()

-- :
--    A           B             C               --
--    .-00        -...00        -.-.00          -- 00
--    .0-00       -0.0.0.00     -0.0-0.00       -- 0
--    10-00       -01010100     -010-0100       -- 1
--    1011100     11101010100   1110101110100   -- 111

local s=""
for w in x:gmatch(".") do         --
    local break_=0
    for i, value in pairs(t) do   --
        if value == w then        --
            s=s .. string.gsub(string.gsub(string.gsub(i, "(.)", "%10") .. "0", "%.", "1"), "%-", "111")  -- , 'A' 1011100
            break_ = 1    --
            break
        end
    end
    if break_ == 0 then s=s .. w .. "00" end   -- , , . .
end
log (" :\r\n" .. s)   --
log()

local ss=""
for w in s:gmatch("(.-)00") do  -- , 00
    if w:match("[01]+") then    --
       ss=ss .. string.gsub(string.gsub(string.gsub(w:gsub("111", "-"), "1", "."), "0", ""), ".+", t)
    else
       ss=ss .. w   -- ,
    end
end
log (" :\r\n" .. ss)


. http://uopilot.tati.pro/index.php?title=Clipboard_(Lua)

, , - biggrin.gif
laugh.gif

t[".-"]="A"
t["-..."]="B"
t["-.-."]="C"
t["-.."]="D"
t["."]= "E"
t["..-."]="F"
t["--."]="G"
t["...."]="H"
t[".."]="I"
t[".---"]="J"
t["-.-"]="K"
t[".-.."]="L"
t["--"]="M"
t["-."]="N"
t["---"]="O"
t[".--."]="P"
t["--.-"]="Q"
t[".-."]="R"
t["..."]="S"
t["-"]="T"
t["..-"]="U"
t[".--"]="W"
t["-..-"]="X"
t["-.--"]="Y"
t["--.."]="Z"


:
ACZBA
:
101110011101011101001110111010100111010101001011100
:
ACZBA
, -.
cirus
-.

.
FREEON
(cirus @ 27.1.2019, 18:26) *

.

, A:
:
.-
:
.00-00
:
.- ( )
2 C, :
:
C
:
1110101110100
:
C ( -.-. ?)
sad.gif
cirus
, A:
:
.-

, 'A' '1011100' '1011100' 'A'.
:
--

? , .
: '.-.-...-..-..-.' , . .
FREEON
, ? ?

--t["""]=""
--t["@"]="""

Hfcrkflrf ->


--lua
--
-- Hfcrkflrf ->
local file= io.open([[C:\123.txt]], "r")          --
local result_file = io.open([[C:\456.txt]], "w")  --

local t={}
t["a"]=""          -- 'a' ''
t["b"]=""
t["c"]=""
t["d"]=""
t["e"]=""
t["f"]=""
t["g"]=""
t["h"]=""
t["i"]=""
t["j"]=""
t["k"]=""
t["l"]=""
t["m"]=""
t["n"]=""
t["o"]=""
t["p"]=""
t["q"]=""
t["r"]=""
t["s"]=""
t["t"]=""
t["u"]=""
t["v"]=""
t["w"]=""
t["x"]=""
t["y"]=""
t["z"]=""
t["`"]=""
t["["]=""
t["]"]=""
t[";"]=""
t["'"]=""
t[","]=""
t["."]=""
t["/"]="."
t["A"]=""
t["B"]=""
t["C"]=""
t["D"]=""
t["E"]=""
t["F"]=""
t["G"]=""
t["H"]=""
t["I"]=""
t["J"]=""
t["K"]=""
t["L"]=""
t["M"]=""
t["N"]=""
t["O"]=""
t["P"]=""
t["Q"]=""
t["R"]=""
t["S"]=""
t["T"]=""
t["U"]=""
t["V"]=""
t["W"]=""
t["X"]=""
t["Y"]=""
t["Z"]=""
t["{"]=""
t["}"]=""
t[":"]=""
--t["""]=""
t["<"]=""
t[">"]=""
t["?"]=","
t["~"]=""
--t["@"]="""
t["#"]=""
t["$"]=";"
t["^"]=":"
t["&"]="?"

if file and result_file then     --
    for v in file:lines() do
        result_file:write(string.gsub(v, ".", t).."\r\n")  -- 't'
    end

    file:close()
    result_file:close()
else
    log (" /")
end

cirus
--lua
local s1 = '"Hello!"'        --
local s2 = "'Hello!'"        --
local s3 = [['"Hello!"']]    --
log (s1)
log (s2)
log (s3)
cirus
t["<"]=""
t[">"]=""
t["?"]=","

1 .
t["<"]=""   t[">"]=""    t["?"]=","

DarkMaster
local s3 = [['"Hello!"']] --

local s4 = [====['"Hello!"']====]
. . = , . .
FREEON
url-... unsure.gif
6 3 ( ):
= %d0%93
= %d1%80
( ; : @ & = + $ , / ? % # [ ]) 3 , 1 , 2- d
= %20 =+
# = %23
{ = %7B
, %d0%af %D0%AF %d1%8f %D1%8F. ?
=> %D0%9A%D0%BE%D0%B4
%D0%9A+%D0%BE+%D0%B4
%D0%9A%20%D0%BE%20%D0%B4
cirus
--lua
log "clear"   log "mode compact"

local s="%D0%9A%D0%BE%D0%B4%20%7Benglish%20text%7D%20%D0%9A%D0%BE%D0%B4%20lua!!!"   -- {english text} lua!!!
log(s)

local t={}
t["%D0%9A"]=""
t["%D0%BE"]=""
t["%D0%B4"]=""
-- ,
--

for v in pairs(t) do   -- , "%D0%9A", "%d0%9a"
    t[v:lower()]=t[v]
end

for i=32, 127 do t["%" .. string.format("%X", i)]=string.char(i) end   -- , ascii 32 127


s=s:gsub("%%[Dd][01]%%%x%x", t)   --
s=s:gsub("%%..", t)               --
log(s)                            --
FREEON
(cirus @ 28.1.2019, 4:24) *

--lua
log "clear"   log "mode compact"

local s="%D0%9A%D0%BE%D0%B4%20%7Benglish%20text%7D%20%D0%9A%D0%BE%D0%B4%20lua!!!"   -- {english text} lua!!!
log(s)

local t={}
t["%D0%9A"]=""
t["%D0%BE"]=""
t["%D0%B4"]=""
-- ,
--

for v in pairs(t) do   -- , "%D0%9A", "%d0%9a"
    t[v:lower()]=t[v]
end

for i=32, 127 do t["%" .. string.format("%X", i)]=string.char(i) end   -- , ascii 32 127
s=s:gsub("%%[Dd][01]%%%x%x", t)   --
s=s:gsub("%%..", t)               --
log(s)                            --


- smile.gif
URL-: %D0%A2%D0%B5%D0%BA%D1%81%D1%82 ->


--lua
log "clear"   log "mode compact"

local s="Cirus-code-master%20%D0%B1%D0%BE%D0%B6%D1%8D%D0%BD%D1%8C%D0%BA%D0%B0!:)"   -- {english text} lua!!!
log(s)

local t={}
t["%D0%90"]="" t["%D0%91"]="" t["%D0%92"]="" t["%D0%93"]="" t["%D0%94"]="" t["%D0%95"]="" t["%D0%81"]="" t["%D0%96"]="" t["%D0%97"]="" t["%D0%98"]="" t["%D0%99"]=""
t["%D0%9A"]="" t["%D0%9B"]="" t["%D0%9C"]="" t["%D0%9D"]="" t["%D0%9E"]="" t["%D0%9F"]="" t["%D0%A0"]="" t["%D0%A1"]="" t["%D0%A2"]="" t["%D0%A3"]="" t["%D0%A4"]=""
t["%D0%A5"]="" t["%D0%A6"]="" t["%D0%A7"]="" t["%D0%A8"]="" t["%D0%A9"]="" t["%D0%AA"]="" t["%D0%AB"]="" t["%D0%AC"]="" t["%D0%AD"]="" t["%D0%AE"]="" t["%D0%AF"]=""
t["%D0%B0"]="" t["%D0%B1"]="" t["%D0%B2"]="" t["%D0%B3"]="" t["%D0%B4"]="" t["%D0%B5"]="" t["%D1%91"]="" t["%D0%B6"]="" t["%D0%B7"]="" t["%D0%B8"]="" t["%D0%B9"]=""
t["%D0%BA"]="" t["%D0%BB"]="" t["%D0%BC"]="" t["%D0%BD"]="" t["%D0%BE"]="" t["%D0%BF"]="" t["%D1%80"]="" t["%D1%81"]="" t["%D1%82"]="" t["%D1%83"]="" t["%D1%84"]=""
t["%D1%85"]="" t["%D1%86"]="" t["%D1%87"]="" t["%D1%88"]="" t["%D1%89"]="" t["%D1%8A"]="" t["%D1%8B"]="" t["%D1%8C"]="" t["%D1%8D"]="" t["%D1%8E"]="" t["%D1%8F"]=""

for v in pairs(t) do   -- , "%D0%9A", "%d0%9a"
    t[v:lower()]=t[v]
end

for i=32, 127 do t["%" .. string.format("%X", i)]=string.char(i) end   -- , ascii 32 127


s=s:gsub("%%[Dd][01]%%%x%x", t)   --
s=s:gsub("%%..", t)               --
log(s)                            --
FREEON
? ? wink.gif
:
! >>> !
cirus
?

--lua
log "clear"  log "mode compact"
local s=" !"
log (s:reverse())

http://uopilot.tati.pro/index.php?title=....BE.D0.BA.D0.B8
FREEON
...

--lua
--log "clear"   log "mode compact"

--local s="-Text-123!"   -- , ""
--log(s)
local file= io.open([[C:\123.txt]], "r")          --
local result_file = io.open([[C:\456.txt]], "w")  --
local t={}
t["1"]=".----"  t["2"]="..---"  t["3"]="...--"  t["4"]="....-"  t["5"]="....."  t["6"]="-...."  t["7"]="--..."
t["8"]="---.."  t["9"]="----."  t["0"]="-----"  t["."]="......" t[":"]="---..." t[";"]="-.-.-." t["("]="-.--.-"
t[")"]="-.--.-" t["'"]=".----." t['"']=".-..-." t["-"]="-....-" t["/"]="-..-."  t["?"]="..--.." t["!"]="--..--"
t[","]=".-.-.-" t["A"]=".-"     t["B"]="-..."   t["C"]="-.-."   t["D"]="-.."    t["E"]="."      t["F"]="..-."
t["G"]="--."    t["H"]="...."   t["I"]=".."     t["J"]=".---"   t["K"]="-.-"    t["L"]=".-.."   t["M"]="--"
t["N"]="-."     t["O"]="---"    t["P"]=".--."   t["Q"]="--.-"   t["R"]=".-."    t["S"]="..."    t["T"]="-"
t["U"]="..-"    t["V"]="...-"   t["W"]=".--"    t["X"]="-..-"   t["Y"]="-.--"   t["Z"]="--.."   t[""]=".-"
t[""]="-..."   t[""]=".--"    t[""]="--."    t[""]="-.."    t[""]="."      t[""]="."      t[""]="...-"
t[""]="--.."   t[""]=".."     t[""]=".---"   t[""]="-.-"    t[""]=".-.."   t[""]="--"     t[""]="-."
t[""]="---"    t[""]=".--."   t[""]=".-."    t[""]="..."    t[""]="-"      t[""]="..-"    t[""]="..-."
t[""]="...."   t[""]="-.-."   t[""]="---."   t[""]="----"   t[""]="--.-"   t[""]="-..-"   t[""]="-..-"
t[""]="-.--"   t[""]="..-.."  t[""]="..--"   t[""]=".-.-"
for v in pairs(t) do   -- , "%", "%"
    t[v:lower()]=t[v]
end

if file and result_file then     --
    for v in file:lines() do
        result_file:write(string.gsub(v, ".", t).."\r\n")  -- 't'
    end

    file:close()
    result_file:close()
else
    log (" /")
end

--log(s)                            --

:
faer


.-- ..-..-..-.

, , ? huh.gif
cirus
v:lower()

.
:
string_lower(v)
FREEON
(cirus @ 28.1.2019, 16:20) *

.
:
string_lower(v)



--lua
log "clear"   log "mode compact"
local text = clipboard ()      -- text
log (text)                     -- text
wait (300)                 -- 300
local arr = clipboard (0, "string", "word") --
log()
local t={}
t["1"]=".----"  t["2"]="..---"  t["3"]="...--"  t["4"]="....-"  t["5"]="....."  t["6"]="-...."  t["7"]="--..."
t["8"]="---.."  t["9"]="----."  t["0"]="-----"  t["."]="......" t[":"]="---..." t[";"]="-.-.-." t["("]="-.--.-"
t[")"]="-.--.-" t["'"]=".----." t['"']=".-..-." t["-"]="-....-" t["/"]="-..-."  t["?"]="..--.." t["!"]="--..--"
t[","]=".-.-.-" t["A"]=".-"     t["B"]="-..."   t["C"]="-.-."   t["D"]="-.."    t["E"]="."      t["F"]="..-."
t["G"]="--."    t["H"]="...."   t["I"]=".."     t["J"]=".---"   t["K"]="-.-"    t["L"]=".-.."   t["M"]="--"
t["N"]="-."     t["O"]="---"    t["P"]=".--."   t["Q"]="--.-"   t["R"]=".-."    t["S"]="..."    t["T"]="-"
t["U"]="..-"    t["V"]="...-"   t["W"]=".--"    t["X"]="-..-"   t["Y"]="-.--"   t["Z"]="--.."   t[""]=".-"
t[""]="-..."   t[""]=".--"    t[""]="--."    t[""]="-.."    t[""]="."      t[""]="."      t[""]="...-"
t[""]="--.."   t[""]=".."     t[""]=".---"   t[""]="-.-"    t[""]=".-.."   t[""]="--"     t[""]="-."
t[""]="---"    t[""]=".--."   t[""]=".-."    t[""]="..."    t[""]="-"      t[""]="..-"    t[""]="..-."
t[""]="...."   t[""]="-.-."   t[""]="---."   t[""]="----"   t[""]="--.-"   t[""]="-..-"   t[""]="-..-"
t[""]="-.--"   t[""]="..-.."  t[""]="..--"   t[""]=".-.-"
for v in pairs(t) do   -- , "%", "%"
    t[string_lower(v)]=t[v]
end
--if --
    for v in file:lines() do
        s=s:write(string.gsub(v, ".", t).."\r\n")  -- 't'
    end
log(s)                            --
clipboard (???)                   --

... ... , ... lua ...
cirus
--lua
log "clear"   log "mode compact"
local text = clipboard ()      -- text

wait (300)                     -- 300
log (text)                     -- text
log()
local t={}
t["1"]=".----"  t["2"]="..---"  t["3"]="...--"  t["4"]="....-"  t["5"]="....."  t["6"]="-...."  t["7"]="--..."
t["8"]="---.."  t["9"]="----."  t["0"]="-----"  t["."]="......" t[":"]="---..." t[";"]="-.-.-." t["("]="-.--.-"
t[")"]="-.--.-" t["'"]=".----." t['"']=".-..-." t["-"]="-....-" t["/"]="-..-."  t["?"]="..--.." t["!"]="--..--"
t[","]=".-.-.-" t["A"]=".-"     t["B"]="-..."   t["C"]="-.-."   t["D"]="-.."    t["E"]="."      t["F"]="..-."
t["G"]="--."    t["H"]="...."   t["I"]=".."     t["J"]=".---"   t["K"]="-.-"    t["L"]=".-.."   t["M"]="--"
t["N"]="-."     t["O"]="---"    t["P"]=".--."   t["Q"]="--.-"   t["R"]=".-."    t["S"]="..."    t["T"]="-"
t["U"]="..-"    t["V"]="...-"   t["W"]=".--"    t["X"]="-..-"   t["Y"]="-.--"   t["Z"]="--.."   t[""]=".-"
t[""]="-..."   t[""]=".--"    t[""]="--."    t[""]="-.."    t[""]="."      t[""]="."      t[""]="...-"
t[""]="--.."   t[""]=".."     t[""]=".---"   t[""]="-.-"    t[""]=".-.."   t[""]="--"     t[""]="-."
t[""]="---"    t[""]=".--."   t[""]=".-."    t[""]="..."    t[""]="-"      t[""]="..-"    t[""]="..-."
t[""]="...."   t[""]="-.-."   t[""]="---."   t[""]="----"   t[""]="--.-"   t[""]="-..-"   t[""]="-..-"
t[""]="-.--"   t[""]="..-.."  t[""]="..--"   t[""]=".-.-"
for v in pairs(t) do   -- , "%", "%"
    t[string_lower(v)]=t[v]
end

local s=text:gsub(".", t)
log(s)                          --
clipboard (s)                   --
FREEON
... .
.
t["1"]=".----"
local s=text:gsub(".", t) --    

".---- " , , . ( )
cirus
for v in pairs(t) do   --    ,   "",   ""

? ? 2 :
t[""]="-"
t[""]="-"

. . '-' 'T' ''. , , .
FREEON
(cirus @ 28.1.2019, 21:18) *

for v in pairs(t) do   --    ,   "",   ""

? ? 2 :
t[""]="-"
t[""]="-"

. . '-' 'T' ''. , , .

, . . , "" , ( ). , ( ) ( ) .
(?) , . ,
cirus
(?)

2 . , . .
1 , .
FREEON
(cirus @ 28.1.2019, 21:50) *

2 . , . .
1 , .

, :

t["1"]=".----"  t["2"]="..---"  t["3"]="...--"  t["4"]="....-"  t["5"]="....."  t["6"]="-...."  t["7"]="--..."
t["8"]="---.."  t["9"]="----."  t["0"]="-----"  t["."]="......" t[":"]="---..." t[";"]="-.-.-." t["("]="-.--.-"
t[")"]="-.--.-" t["'"]=".----." t['"']=".-..-." t["-"]="-....-" t["/"]="-..-."  t["?"]="..--.." t["!"]="--..--"
t[","]=".-.-.-" t["A"]=".-"     t["B"]="-..."   t["C"]="-.-."   t["D"]="-.."    t["E"]="."      t["F"]="..-."
t["G"]="--."    t["H"]="...."   t["I"]=".."     t["J"]=".---"   t["K"]="-.-"    t["L"]=".-.."   t["M"]="--"
t["N"]="-."     t["O"]="---"    t["P"]=".--."   t["Q"]="--.-"   t["R"]=".-."    t["S"]="..."    t["T"]="-"
t["U"]="..-"    t["V"]="...-"   t["W"]=".--"    t["X"]="-..-"   t["Y"]="-.--"   t["Z"]="--.."

:

t["1"]=".----"  t["2"]="..---"  t["3"]="...--"  t["4"]="....-"  t["5"]="....."  t["6"]="-...."  t["7"]="--..."
t["8"]="---.."  t["9"]="----."  t["0"]="-----"  t["."]="......" t[":"]="---..." t[";"]="-.-.-." t["("]="-.--.-"
t[")"]="-.--.-" t["'"]=".----." t['"']=".-..-." t["-"]="-....-" t["/"]="-..-."  t["?"]="..--.." t["!"]="--..--"
t[","]=".-.-.-" t[""]=".-"     t[""]="-..."   t[""]=".--"    t[""]="--."    t[""]="-.."    t[""]="."
t[""]="."      t[""]="...-"   t[""]="--.."   t[""]=".."     t[""]=".---"   t[""]="-.-"    t[""]=".-.."
t[""]="--"     t[""]="-."     t[""]="---"    t[""]=".--."   t[""]=".-."    t[""]="..."    t[""]="-"
t[""]="..-"    t[""]="..-."   t[""]="...."   t[""]="-.-."   t[""]="---."   t[""]="----"   t[""]="--.-"
t[""]="-..-"   t[""]="-..-"   t[""]="-.--"   t[""]="..-.."  t[""]="..--"   t[""]=".-.-"

, ( ) ( ), , ((
cirus
,

? .
FREEON
(cirus @ 28.1.2019, 22:39) *

? .

, . " " "\"
: \
local s=text:gsub(".", t) + \ --
t[""]="-.-" "-.-\"
:

-.-\.-\-.-\\-..\.\.-..\.-\
                 
➀  ➁ ➀ \ ➂ ➃  ➄   ➁

\ , \, , cool.gif
url
%
:%%D0%B1%%D0%BE%%D0%B6%%D1%8D%%D0%BD%%D1%8C%%D0%BA%%D0%B0
:%%%%%%%%
()
cirus
--lua
log "clear"  log "mode compact"

local text=[[-.-\.-\-.-\\\-..\.\.-..\.-\]]     -- " "
--local text=" "     --  [[-.-\.-\-.-\\\-..\.\.-..\.-\]]
log(text)

local t, t1, temp = {}, {}, {}
t[""]=".-"     t[""]="-..."   t[""]=".--"    t[""]="--."    t[""]="-.."    t[""]="."    t[""]="."
t[""]="...-"   t[""]="--.."   t[""]=".."     t[""]=".---"   t[""]="-.-"    t[""]=".-.."   t[""]="--"
t[""]="-."     t[""]="---"    t[""]=".--."   t[""]=".-."    t[""]="..."    t[""]="-"   t[""]="..-"
t[""]="..-."   t[""]="...."   t[""]="-.-."   t[""]="---."   t[""]="----"   t[""]="--.-"   t[""]="-..-"
t[""]="-..-"   t[""]="-.--"   t[""]="..-.."  t[""]="..--"   t[""]=".-.-"
for v in pairs(t) do temp[string_lower(v)]=t[v] end
for v in pairs(temp) do t[v]=temp[v] end
t["1"]=".----"  t["2"]="..---"  t["3"]="...--"  t["4"]="....-"  t["5"]="....."  t["6"]="-...."  t["7"]="--..."
t["8"]="---.."  t["9"]="----."  t["0"]="-----"  t["."]="......" t[":"]="---..." t[";"]="-.-.-." t["("]="-.--.-"
t[")"]="-.--.-" t["'"]=".----." t['"']=".-..-." t["-"]="-....-" t["/"]="-..-."  t["?"]="..--.." t["!"]="--..--"
t[","]=".-.-.-"
for v in pairs(t) do t1[t[v]]=v end   -- , 't'

local x=0
for v in text:gmatch("[%.%-%\\]") do x=x+1 end  -- ,

if x > #text*50/100 then   -- 50%,
    text=string.gsub(text:gsub("(.-)\\", t1), "\\\\", " ")    --
else
    text=string.gsub(string.gsub(text:gsub("([^ ])", "%1\\"), "%s", "\\\\"), "[^\\]", t)   --
end
log (text)
FREEON
(cirus @ 29.1.2019, 0:50) *

--lua
log "clear"  log "mode compact"

local text=[[-.-\.-\-.-\\\-..\.\.-..\.-\]]     -- " "
--local text=" "     --  [[-.-\.-\-.-\\\-..\.\.-..\.-\]]
log(text)

local t, t1, temp = {}, {}, {}
t[""]=".-"     t[""]="-..."   t[""]=".--"    t[""]="--."    t[""]="-.."    t[""]="."    t[""]="."
t[""]="...-"   t[""]="--.."   t[""]=".."     t[""]=".---"   t[""]="-.-"    t[""]=".-.."   t[""]="--"
t[""]="-."     t[""]="---"    t[""]=".--."   t[""]=".-."    t[""]="..."    t[""]="-"   t[""]="..-"
t[""]="..-."   t[""]="...."   t[""]="-.-."   t[""]="---."   t[""]="----"   t[""]="--.-"   t[""]="-..-"
t[""]="-..-"   t[""]="-.--"   t[""]="..-.."  t[""]="..--"   t[""]=".-.-"
for v in pairs(t) do temp[string_lower(v)]=t[v] end
for v in pairs(temp) do t[v]=temp[v] end
t["1"]=".----"  t["2"]="..---"  t["3"]="...--"  t["4"]="....-"  t["5"]="....."  t["6"]="-...."  t["7"]="--..."
t["8"]="---.."  t["9"]="----."  t["0"]="-----"  t["."]="......" t[":"]="---..." t[";"]="-.-.-." t["("]="-.--.-"
t[")"]="-.--.-" t["'"]=".----." t['"']=".-..-." t["-"]="-....-" t["/"]="-..-."  t["?"]="..--.." t["!"]="--..--"
t[","]=".-.-.-"
for v in pairs(t) do t1[t[v]]=v end   -- , 't'

local x=0
for v in text:gmatch("[%.%-%\\]") do x=x+1 end  -- ,

if x > #text*50/100 then   -- 50%,
    text=string.gsub(text:gsub("(.-)\\", t1), "\\\\", " ")    --
else
    text=string.gsub(string.gsub(text:gsub("([^ ])", "%1\\"), "%s", "\\\\"), "[^\\]", t)   --
end
log (text)


lua set delimiter ' ' ?

for i, word in pairs(split(text, "<(.-)>")) do
    print(word)
end

function split(string, delimiter) -- Got this function from [url=https://helloacm.com/split-a-string-in-lua/]https://helloacm.com/split-a-string-in-lua/[/url]
    result = {};

    for match in (string..delimiter):gmatch("(.-)"..delimiter) do
        table.insert(result, match);
    end

    return result;
end


This code replaces the parts in the format "<(.-)>"

Example:
Input: "Hello<a>World</a>!"

Expected Output: {"Hello", "<a>", "World", "</a>", "!"}

Real Output: {"Hello", "World", "!"}


s = "Hello<a>World</a>!"
for a in s:gsub('%b<>','\0%0\0'):gmatch'%Z+' do
  print(a)
end
cirus
lua set delimiter ' ' ?

. ?
FREEON
(cirus @ 29.1.2019, 1:43) *

. ?

sad.gif
- ...

--lua
function split(s, sep)
    local fields = {}

    local sep = sep or " "
    local pattern = string.format("([^%s]+)", sep)
    string.gsub(s, pattern, function(c) fields[#fields + 1] = c end)

    return fields
end

t = split("a,b,c,d,e,f,g",",")
for i,j in pairs(t) do
    log(i,j)
end


--lua
local arr = {"", "", "", ""}
log (table.concat(arr, " "))    --

http://uopilot.tati.pro/index.php?title=Table.concat_(Lua)
cirus
, . .
sutra
, . . - "" . , - -. - , .
FREEON
(cirus @ 29.1.2019, 3:02) *

, . .

Lua , ... ... mellow.gif
%s --
http://uopilot.tati.pro/index.php?title=String.gsub_(Lua)
FREEON
(FREEON @ 29.1.2019, 11:47) *

- ...

--lua
log "clear"  log "mode compact"

local text=[[..-.. .---  - .- -- ]]     -- " "
--local text=" "     --  [[-.-\.-\-.-\\\-..\.\.-..\.-\]]
log(text)

local t, t1, temp = {}, {}, {}
t[""]=".-"     t[""]="-..."   t[""]=".--"    t[""]="--."    t[""]="-.."    t[""]="."    t[""]="."
t[""]="...-"   t[""]="--.."   t[""]=".."     t[""]=".---"   t[""]="-.-"    t[""]=".-.."   t[""]="--"
t[""]="-."     t[""]="---"    t[""]=".--."   t[""]=".-."    t[""]="..."    t[""]="-"   t[""]="..-"
t[""]="..-."   t[""]="...."   t[""]="-.-."   t[""]="---."   t[""]="----"   t[""]="--.-"   t[""]="-..-"
t[""]="-..-"   t[""]="-.--"   t[""]="..-.."  t[""]="..--"   t[""]=".-.-"
for v in pairs(t) do temp[string_lower(v)]=t[v] end
for v in pairs(temp) do t[v]=temp[v] end
t["1"]=".----"  t["2"]="..---"  t["3"]="...--"  t["4"]="....-"  t["5"]="....."  t["6"]="-...."  t["7"]="--..."
t["8"]="---.."  t["9"]="----."  t["0"]="-----"  t["."]="......" t[":"]="---..." t[";"]="-.-.-." t["("]="-.--.-"
t[")"]="-.--.-" t["'"]=".----." t['"']=".-..-." t["-"]="-....-" t["/"]="-..-."  t["?"]="..--.." t["!"]="--..--"
t[","]=".-.-.-"
for v in pairs(t) do t1[t[v]]=v end   -- , 't'

local x=0
for v in text:gmatch("[%.%-%(%s)]") do x=x+1 end  -- ,

if x > #text*50/100 then   -- 50%,
    text=string.gsub(text:gsub("(.-)(%s)", t1), "(%s)(%s)", " ")    --
else
    text=string.gsub(string.gsub(text:gsub("([^ ])", "%1 "), "%s", " "), "[^ ]", t)   --
end
log (text)

rolleyes.gif
DarkMaster
in pairs(t)

. next - , .
cirus
--lua
log "clear"  log "mode compact"

local text=[[-.- .- -.-   -.. . .-.. .-]]     -- " "
--local text=" "     --  [[-.-\.-\-.-\\\-..\.\.-..\.-\]]
log(text)

local t, t1, temp = {}, {}, {}
t[""]=".-"     t[""]="-..."   t[""]=".--"    t[""]="--."    t[""]="-.."    t[""]="."    t[""]="."
t[""]="...-"   t[""]="--.."   t[""]=".."     t[""]=".---"   t[""]="-.-"    t[""]=".-.."   t[""]="--"
t[""]="-."     t[""]="---"    t[""]=".--."   t[""]=".-."    t[""]="..."    t[""]="-"   t[""]="..-"
t[""]="..-."   t[""]="...."   t[""]="-.-."   t[""]="---."   t[""]="----"   t[""]="--.-"   t[""]="-..-"
t[""]="-..-"   t[""]="-.--"   t[""]="..-.."  t[""]="..--"   t[""]=".-.-"
for v in pairs(t) do temp[string_lower(v)]=t[v] end
for v in pairs(temp) do t[v]=temp[v] end
t["1"]=".----"  t["2"]="..---"  t["3"]="...--"  t["4"]="....-"  t["5"]="....."  t["6"]="-...."  t["7"]="--..."
t["8"]="---.."  t["9"]="----."  t["0"]="-----"  t["."]="......" t[":"]="---..." t[";"]="-.-.-." t["("]="-.--.-"
t[")"]="-.--.-" t["'"]=".----." t['"']=".-..-." t["-"]="-....-" t["/"]="-..-."  t["?"]="..--.." t["!"]="--..--"
t[","]=".-.-.-"
for v in pairs(t) do t1[t[v]]=v end   -- , 't'

local x=0
for v in text:gmatch("[%.%- ]") do x=x+1 end  -- ,

if x > #text*50/100 then   -- 50%,
    text=string.gsub((text .. " "):gsub("(.-) ", t1), "  ", " ")    --
else
    text=string.gsub(text:gsub("(.)", "%1 "), "[^ ]", t)  --
end
log (text)
FREEON
CP1251 UTF-8

--lua
log ("clear")   log ("mode compact")
local q = clipboard ()      -- text

wait (300)                     -- 300
log (q)                     -- text
log()
local t={}
t["А"]="" t["Б"]="" t["В"]="" t["Г"]="" t["Д"]="" t["Е"]="" t["Ё"]="" t["Ж"]="" t["З"]="" t["И"]="" t["Й"]=""
t["К"]="" t["Л"]="" t["М"]="" t["Н"]="" t["О"]="" t["П"]="" t["Р"]="" t["С"]="" t["Т"]="" t["У"]="" t["Ф"]=""
t["Х"]="" t["Ц"]="" t["Ч"]="" t["Ш"]="" t["Щ"]="" t["Ъ"]="" t["Ы"]="" t["Ь"]="" t["Э"]="" t["Ю"]="" t["Я"]=""
t["а"]="" t["б"]="" t["в"]="" t["г"]="" t["д"]="" t["е"]="" t["ё"]="" t["ж"]="" t["з"]="" t["и"]="" t["й"]=""
t["к"]="" t["л"]="" t["м"]="" t["н"]="" t["о"]="" t["п"]="" t["р"]="" t["с"]="" t["т"]="" t["%у"]="" t["ф"]=""
t["х"]="" t["ц"]="" t["ч"]="" t["ш"]="" t["щ"]="" t["ъ"]="" t["ы"]="" t["ь"]="" t["э"]="" t["ю"]="" t["я"]=""
local s = (string.gsub(q, "[]x", t))  -- ???
log (s)
clipboard (s)                  --

:
абвгдеёжзийклмнопрстуфхцчшщъыьэюя
АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ
FREEON
. file1.txt ():
, * "
, </tr> , <tr> </tr> <tr>
file2.html <!-- 1 --> file1.txt
,
Fors1k
(FREEON @ 29.10.2019, 16:14) *

. file1.txt ():
, * "
, </tr> , <tr> </tr> <tr>
file2.html <!-- 1 --> file1.txt
,

//-----
set $a *
set $a1 "
set $b </tr> , <tr>
set $b1 </tr> <tr>
set $c "<!-- 1 -->"
//-----
load_array %file1 c:/2/file1.txt
for #i 1 size(%file1)
    set $file1 %file1[#i]
    set %file1[#i] string_replace($file1 $a $a1 all)
    set $file1 %file1[#i]
    set %file1[#i] string_replace($file1 $b $b1 all)
end_for
load_array %file2 c:/2/file2.txt
set #res indexOf(%file2 noabs ($c))
set #nd #res - 1
for #i 1 #nd
    set %file2a[#i] %file2[#i]
end_for
for #i 1 size(%file1)
    set #j #i + #nd
    set %file2a[#j] %file1[#i]
end_for
save_array %file2a c:/2/file2_new.txt
set #res1 #res + 1
for #i #res1 size(%file2)
    write (c:/2/file2_new.txt %file2[#i] \r\n)
end_for
end_script
FREEON
(Fors1k @ 30.10.2019, 1:59) *


indexOf . ... - .

//-----
set $a *
set $a1 "
set $b </tr> , <tr>
set $b1 </tr> <tr>
set $c "<!-- 1 -->"
//-----
load_array %file1 c:\123.txt
for #i 1 size(%file1)
    set $file1 %file1[#i]
    set %file1[#i] string_replace($file1 $a $a1 all)
    set $file1 %file1[#i]
    set %file1[#i] string_replace($file1 $b $b1 all)
    //write (D:\123\1_rez.txt %file1[#i] \r\n) // .
end_for

load_array %file2 D:\123\2.txt
set #res indexOf(%file2 noabs ($c))
set #nd #res - 1
for #i 1 #nd
    set %file2a[#i] %file2[#i]
end_for
for #i 1 size(%file1)
    set #j #i + #nd
    set %file2a[#j] %file1[#i]
    //write (D:\123\2_new.txt %file2a[#i] \r\n)  // 3() #i #j
end_for
//save_array %file2a D:\123\2_new.txt  // 0
end_script          //
set #res1 #res + 1
for #i #res1 size(%file2)
    write (D:\123\2_new.txt %file2[#i] \r\n)
end_for
end_script
cirus
. file1.txt ():
, * "
, </tr> , <tr> </tr> <tr>

--lua
local file= io.open([[C:\123.txt]], "r")          --
local result_file = io.open([[C:\456.txt]], "w")  --

if file and result_file then     --
    for v in file:lines() do
        local s=v:gsub("*", '"')  --
        s=s:gsub("(</tr>)( , )(<tr>)", "%1 %3")  --
        result_file:write(s .. "\n")
    end

    file:close()
    result_file:close()
else
    log (" /")
end
. , , .
Invision Power Board © 2001-2024 Invision Power Services, Inc.