<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Пакетное удаление текста в строке по заданному шаблону]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=9271</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=9271&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Пакетное удаление текста в строке по заданному шаблону».]]></description>
		<lastBuildDate>Mon, 24 Feb 2014 13:24:27 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Пакетное удаление текста в строке по заданному шаблону]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=80353#p80353</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Ну так там вариантов не так много.</p></blockquote></div><div class="codebox"><pre><code>Loop, E:\Новая папка\*.html, , 1
{
   utf := &quot;&quot;
   FileRead, text, % A_LoopFileLongPath
   if RegExMatch(text, &quot;&lt;meta.*?charset=utf-8&quot;&quot;&gt;&quot;) &amp;&amp; utf := 1
      FileRead, text, % &quot;*P65001 &quot; A_LoopFileLongPath
   FileDelete, % A_LoopFileLongPath
   text := RegExReplace(text, &quot;Вредная и опасная&quot;)
   FileAppend, % text, % A_LoopFileLongPath, % &quot;CP&quot; . (utf ? &quot;65001&quot; : &quot;1251&quot;)
}</code></pre></div><p>Вот так вроде уже работает...</p>]]></description>
			<author><![CDATA[null@example.com (Эдвард)]]></author>
			<pubDate>Mon, 24 Feb 2014 13:24:27 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=80353#p80353</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Пакетное удаление текста в строке по заданному шаблону]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=80351#p80351</link>
			<description><![CDATA[<p>Ну так там вариантов не так много.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 24 Feb 2014 12:47:39 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=80351#p80351</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Пакетное удаление текста в строке по заданному шаблону]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=80350#p80350</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>А работает? <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p></blockquote></div><p>Нет (хоть и не показывает ошибку).</p>]]></description>
			<author><![CDATA[null@example.com (Эдвард)]]></author>
			<pubDate>Mon, 24 Feb 2014 12:33:55 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=80350#p80350</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Пакетное удаление текста в строке по заданному шаблону]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=80349#p80349</link>
			<description><![CDATA[<div class="quotebox"><cite>Эдвард пишет:</cite><blockquote><p>Так?</p></blockquote></div><p>А работает? <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 24 Feb 2014 12:28:40 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=80349#p80349</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Пакетное удаление текста в строке по заданному шаблону]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=80348#p80348</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Гляньте в Loop (files &amp; folders).</p></blockquote></div><p>Так?</p><div class="codebox"><pre><code>Loop, E:\Новая папка\*.html, 1
{
   utf := &quot;&quot;
   FileRead, text, % A_LoopFileLongPath
   if RegExMatch(text, &quot;&lt;meta.*?charset=utf-8&quot;&quot;&gt;&quot;) &amp;&amp; utf := 1
      FileRead, text, % &quot;*P65001 &quot; A_LoopFileLongPath
   FileDelete, % A_LoopFileLongPath
   text := RegExReplace(text, &quot;Вредная и опасная&quot;)
   FileAppend, % text, % A_LoopFileLongPath, % &quot;CP&quot; . (utf ? &quot;65001&quot; : &quot;1251&quot;)
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Эдвард)]]></author>
			<pubDate>Mon, 24 Feb 2014 12:26:27 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=80348#p80348</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Пакетное удаление текста в строке по заданному шаблону]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=80347#p80347</link>
			<description><![CDATA[<div class="quotebox"><cite>Эдвард пишет:</cite><blockquote><p>А хотелось бы, чтобы распространялась и на все подпапки.</p></blockquote></div><p>Гляньте в Loop (files &amp; folders).</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 24 Feb 2014 12:21:28 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=80347#p80347</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Пакетное удаление текста в строке по заданному шаблону]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=80345#p80345</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Тогда так можно:...</p></blockquote></div><p>Спасибо за готовое решение. Самому пришлось бы мучиться с этой кодировкой очень долго.</p><p>Но всё же остался один нерешённый нюанс. Команда работает только с той папкой, которая указана в шаблоне имени. А хотелось бы, чтобы распространялась и на все подпапки.</p>]]></description>
			<author><![CDATA[null@example.com (Эдвард)]]></author>
			<pubDate>Mon, 24 Feb 2014 12:07:06 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=80345#p80345</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Пакетное удаление текста в строке по заданному шаблону]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=80321#p80321</link>
			<description><![CDATA[<p>Тогда так можно:<br /></p><div class="codebox"><pre><code>Loop, E:\Новая папка\*.html
{
   utf := &quot;&quot;
   FileRead, text, % A_LoopFileLongPath
   if RegExMatch(text, &quot;&lt;meta.*?charset=utf-8&quot;&quot;&gt;&quot;) &amp;&amp; utf := 1
      FileRead, text, % &quot;*P65001 &quot; A_LoopFileLongPath
   FileDelete, % A_LoopFileLongPath
   text := RegExReplace(text, &quot;Вредная и опасная&quot;)
   FileAppend, % text, % A_LoopFileLongPath, % &quot;CP&quot; . (utf ? &quot;65001&quot; : &quot;1251&quot;)
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sun, 23 Feb 2014 17:39:08 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=80321#p80321</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Пакетное удаление текста в строке по заданному шаблону]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=80320#p80320</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Ради интереса, пришлите через Attachments или через какой-нибудь сервис файл, который с кракозябрами считывается.</p></blockquote></div><p>Вот так выглядит файл в первозданном виде: <a href="http://med-75.narod.ru/34/335.html">http://med-75.narod.ru/34/335.html</a>.</p><p>И вот так – после выполнения команды: <a href="http://med-75.narod.ru/34/335-1.html">http://med-75.narod.ru/34/335-1.html</a>.</p>]]></description>
			<author><![CDATA[null@example.com (Эдвард)]]></author>
			<pubDate>Sun, 23 Feb 2014 17:00:58 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=80320#p80320</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Пакетное удаление текста в строке по заданному шаблону]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=80298#p80298</link>
			<description><![CDATA[<p>Можно только так, как в справке прописано. Ради интереса, пришлите через Attachments или через какой-нибудь сервис файл, который с кракозябрами считывается.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sun, 23 Feb 2014 11:19:31 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=80298#p80298</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Пакетное удаление текста в строке по заданному шаблону]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=80294#p80294</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Нужно посмотреть кодировку исходного файла и, если она не соответствует кодировке используемого интерпретатора, указать её в командах FileRead и FileAppend.</p></blockquote></div><p>Указал:</p><div class="codebox"><pre><code>Loop, E:\Новая папка\*.html
{
   FileRead, text, % A_LoopFileLongPath, UTF-8
   FileDelete, % A_LoopFileLongPath
   text := RegExReplace(text, &quot;Вредная и опасная&quot;)
   FileAppend, % text, % A_LoopFileLongPath, UTF-8
}</code></pre></div><p>Только если в теле html-файла имеется &quot;charset=utf-8&quot;, после выполнении команды вся кириллица превращается в кракозябры (при &quot;charset=windows-1251&quot; команда выполняется нормально).</p><p>Отсюда вопрос: можно ли для считывания текста файла в переменную указать универсальную (двойную) кодировку, а для записи только UTF-8?</p>]]></description>
			<author><![CDATA[null@example.com (Эдвард)]]></author>
			<pubDate>Sun, 23 Feb 2014 10:04:51 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=80294#p80294</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Пакетное удаление текста в строке по заданному шаблону]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=80247#p80247</link>
			<description><![CDATA[<p>Нужно посмотреть кодировку исходного файла и, если она не соответствует кодировке используемого интерпретатора, указать её в командах FileRead и FileAppend.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Fri, 21 Feb 2014 13:47:34 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=80247#p80247</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Пакетное удаление текста в строке по заданному шаблону]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=80239#p80239</link>
			<description><![CDATA[<p>Странно. Стоило поменять расширение, и код перестал работать:</p><div class="codebox"><pre><code>Loop, E:\Новая папка\*.html
{
   FileRead, text, % A_LoopFileLongPath
   FileDelete, % A_LoopFileLongPath
   text := RegExReplace(text, &quot;Вредная и опасная&quot;)
   FileAppend, % text, % A_LoopFileLongPath
}</code></pre></div><p>Опять чего-то не учёл (возможно, дело в кодировке)...</p>]]></description>
			<author><![CDATA[null@example.com (Эдвард)]]></author>
			<pubDate>Fri, 21 Feb 2014 10:31:25 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=80239#p80239</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Пакетное удаление текста в строке по заданному шаблону]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=80234#p80234</link>
			<description><![CDATA[<p>Большое спасибо. Заработало!</p>]]></description>
			<author><![CDATA[null@example.com (Эдвард)]]></author>
			<pubDate>Fri, 21 Feb 2014 08:04:56 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=80234#p80234</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Пакетное удаление текста в строке по заданному шаблону]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=80225#p80225</link>
			<description><![CDATA[<div class="codebox"><pre><code>Loop, E:\Новая папка\*.txt
{
   FileRead, text, % A_LoopFileLongPath
   FileDelete, % A_LoopFileLongPath
   text := RegExReplace(text, &quot;Вредная и опасная&quot;)
   FileAppend, % text, % A_LoopFileLongPath
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 20 Feb 2014 21:58:35 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=80225#p80225</guid>
		</item>
	</channel>
</rss>
