<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; CMD/BAT: транслитерация текста]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=2390&amp;type=atom" />
	<updated>2009-01-01T04:15:52Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=2390</id>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: транслитерация текста]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=17750#p17750" />
			<content type="html"><![CDATA[<p>+ возможность интерактивного ввода текста<br />+ более лаконичный код</p><div class="codebox"><pre><code>@chcp 1251&gt;nul
@echo off 
if &quot;%*&quot;==&quot;&quot; set /p word=Введи текст:  &amp;&amp;goto 2
if not exist %1 goto 1

for /f &quot;delims=&quot; %%a in (%1) do set word=%%a &amp; call :2
exit /b

:1
set word=%*
:2
set word=%word:а=a%
SET word=%word:б=b%
SET word=%word:в=v%
SET word=%word:г=g% 
SET word=%word:д=d%
SET word=%word:е=e%
SET word=%word:ё=jo% 
SET word=%word:ж=zh% 
SET word=%word:з=z% 
SET word=%word:и=i% 
SET word=%word:й=j% 
SET word=%word:к=k% 
SET word=%word:л=l% 
SET word=%word:м=m% 
SET word=%word:н=n% 
SET word=%word:о=o% 
SET word=%word:п=p% 
SET word=%word:р=r% 
SET word=%word:с=s% 
SET word=%word:т=t% 
SET word=%word:у=u% 
SET word=%word:ф=f% 
SET word=%word:х=h%
SET word=%word:ц=ts% 
SET word=%word:ч=ch% 
SET word=%word:ш=sh% 
SET word=%word:щ=sch%
SET word=%word:ъ=&quot;% 
SET word=%word:ы=y% 
SET word=%word:ь=`% 
SET word=%word:э=e% 
SET word=%word:ю=ju% 
SET word=%word:я=ja%

echo %word%

::pause</code></pre></div>]]></content>
			<author>
				<name><![CDATA[kiber_punk]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=23894</uri>
			</author>
			<updated>2009-01-01T04:15:52Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=17750#p17750</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: транслитерация текста]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=15339#p15339" />
			<content type="html"><![CDATA[<p>Доработка. С поддержкой транслитерации файлов.<br />translator.bat </p><div class="codebox"><pre><code>@echo off 
if &quot;%*&quot;==&quot;&quot; goto :eof
if not exist %1 goto istext

setlocal  enabledelayedexpansion
for /f &quot;delims=&quot; %%a in (%1) do (
    set words=%%a
    set words=!words:а=a!
    set words=!words:б=b!
    set words=!words:в=v!
    set words=!words:г=g!
    set words=!words:д=d!
    set words=!words:е=e!
    set words=!words:ё=jo!
    set words=!words:ж=zh!
    set words=!words:з=z!
    set words=!words:и=i!
    set words=!words:й=j!
    set words=!words:к=k!
    set words=!words:л=l!
    set words=!words:м=m!
    set words=!words:н=n!
    set words=!words:о=o!
    set words=!words:п=p!
    set words=!words:р=r!
    set words=!words:с=s!
    set words=!words:т=t!
    set words=!words:у=u!
    set words=!words:ф=f!
    set words=!words:х=h!
    set words=!words:ц=ts!
    set words=!words:ч=ch!
    set words=!words:ш=sh!
    set words=!words:щ=sch!
    set words=!words:ъ=&#039;&#039;!
    set words=!words:ы=i!
    set words=!words:ь=&#039;!
    set words=!words:э=eh!
    set words=!words:ю=ju!
    set words=!words:я=ja!

    echo !words!
)
endlocal

exit /b

:istext
set word=%*
set word=%word:а=a%
SET word=%word:б=b%
SET word=%word:в=v%
SET word=%word:г=g% 
SET word=%word:д=d%
SET word=%word:е=e%
SET word=%word:ё=jo% 
SET word=%word:ж=zh% 
SET word=%word:з=z% 
SET word=%word:и=i% 
SET word=%word:й=j% 
SET word=%word:к=k% 
SET word=%word:л=l% 
SET word=%word:м=m% 
SET word=%word:н=n% 
SET word=%word:о=o% 
SET word=%word:п=p% 
SET word=%word:р=r% 
SET word=%word:с=s% 
SET word=%word:т=t% 
SET word=%word:у=u% 
SET word=%word:ф=f% 
SET word=%word:х=h%
SET word=%word:ц=ts% 
SET word=%word:ч=ch% 
SET word=%word:ш=sh% 
SET word=%word:щ=sch%
SET word=%word:ъ=&quot;% 
SET word=%word:ы=y% 
SET word=%word:ь=`% 
SET word=%word:э=e% 
SET word=%word:ю=ju% 
SET word=%word:я=ja%

echo %word%</code></pre></div><p>запуск для обработки файла:</p><div class="quotebox"><blockquote><p>TRANSLATOR [text.txt] [&gt;translit.txt]</p></blockquote></div><p>запуск для обработки строки:</p><div class="quotebox"><blockquote><p>TRANSLATOR [строка для перевода]&nbsp; [&gt;translit.txt]</p></blockquote></div><p>__<br />Спасибо <strong>alexii</strong> за помощь в разработке скрипта.</p>]]></content>
			<author>
				<name><![CDATA[kiber_punk]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=23894</uri>
			</author>
			<updated>2008-10-30T01:58:25Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=15339#p15339</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[CMD/BAT: транслитерация текста]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=15336#p15336" />
			<content type="html"><![CDATA[<p>translit.bat<br /></p><div class="codebox"><pre><code>@echo off 
chcp 1251&gt;nul 
set &quot;word=%*&quot;
set &quot;word=%word:а=a%&quot;
SET &quot;word=%word:б=b%&quot;
SET &quot;word=%word:в=v%&quot;
SET &quot;word=%word:г=g%&quot; 
SET &quot;word=%word:д=d%&quot;
SET &quot;word=%word:е=e%&quot;
SET &quot;word=%word:ё=jo%&quot; 
SET &quot;word=%word:ж=zh%&quot; 
SET &quot;word=%word:з=z%&quot; 
SET &quot;word=%word:и=i%&quot; 
SET &quot;word=%word:й=j%&quot; 
SET &quot;word=%word:к=k%&quot; 
SET &quot;word=%word:л=l%&quot; 
SET &quot;word=%word:м=m%&quot; 
SET &quot;word=%word:н=n%&quot; 
SET &quot;word=%word:о=o%&quot; 
SET &quot;word=%word:п=p%&quot; 
SET &quot;word=%word:р=r%&quot; 
SET &quot;word=%word:с=s%&quot; 
SET &quot;word=%word:т=t%&quot; 
SET &quot;word=%word:у=u%&quot; 
SET &quot;word=%word:ф=f%&quot; 
SET &quot;word=%word:х=h%&quot;
SET &quot;word=%word:ц=ts%&quot; 
SET &quot;word=%word:ч=ch%&quot; 
SET &quot;word=%word:ш=sh%&quot; 
SET &quot;word=%word:щ=sch%&quot; 
SET &quot;word=%word:ъ=&quot;%&quot; 
SET &quot;word=%word:ы=y%&quot; 
SET &quot;word=%word:ь=`%&quot; 
SET &quot;word=%word:э=e%&quot; 
SET &quot;word=%word:ю=ju%&quot; 
SET &quot;word=%word:я=ja%&quot; 

echo %word%</code></pre></div><p>запуск</p><div class="quotebox"><blockquote><p>TRANSLIT.bat [текст для перевода] [&gt;транслит.txt]</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[kiber_punk]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=23894</uri>
			</author>
			<updated>2008-10-29T20:34:22Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=15336#p15336</id>
		</entry>
</feed>
