<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Поиск строки в текстовом файле]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=18447&amp;type=atom" />
	<updated>2025-05-11T17:53:32Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=18447</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск строки в текстовом файле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162473#p162473" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Не забывайте использовать заглавные буквы и точки.</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2025-05-11T17:53:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162473#p162473</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск строки в текстовом файле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162472#p162472" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Я не такой умный как вы. Честно я ничего не понимаю в этих регулярках<br />Ну вот что это такое &quot;`amO)(?:О|о) как это можно понять ?<br />Вот это ([\d.]+) понятно, ищет числа</p>]]></content>
			<author>
				<name><![CDATA[FeklaLvovna]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=44749</uri>
			</author>
			<updated>2025-05-11T15:26:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162472#p162472</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск строки в текстовом файле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162471#p162471" />
			<content type="html"><![CDATA[<p>Судя по всему, вам скрипт нужен для игры, переношу в тему по играм. Не забывайте использовать заглавные буквы и точки.<br /></p><div class="quotebox"><cite>FeklaLvovna пишет:</cite><blockquote><p>помогите еще составить регулярное выражение</p></blockquote></div><p>А как насчёт попробовать самостоятельно?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2025-05-11T13:58:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162471#p162471</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск строки в текстовом файле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162470#p162470" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Извиняюсь, помогите еще составить регулярное выражение под такую строку.<br />[21:35:39] - Информация: Очки 250.12 изумруд(ов). Введите {FFFFFF}&quot;/accept [ 100 ]&quot;{3B9FF3} чтобы взять предмет</p><p>так-же нужно извлечь числа <br />очки 250.12<br />accept 100</p>]]></content>
			<author>
				<name><![CDATA[FeklaLvovna]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=44749</uri>
			</author>
			<updated>2025-05-11T09:32:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162470#p162470</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск строки в текстовом файле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162464#p162464" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>FileRead, text, C:\test.txt
min := 0xFFFFFFFF
id := &quot;&quot;
while RegExMatch(text, &quot;`amO)(?:О|о)чки: ([\d.]+),.*\[(\d+)]$&quot;, m, m ? m.Pos + 1 : 1) {
    if (m[1] + 0 &lt; min) {
        min := m[1] + 0
        id := m[2]
    }
}
MsgBox % id</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2025-05-10T12:31:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162464#p162464</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск строки в текстовом файле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162463#p162463" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Очки, id, остальное меняется, в начале еще добавляется время</p><p>[21:02:25] очки: 5.0, id [123]<br />[22:08:26] очки: 3.0, id [124]<br />[23:09:29] очки: 4.0, id [125]</p>]]></content>
			<author>
				<name><![CDATA[FeklaLvovna]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=44749</uri>
			</author>
			<updated>2025-05-10T10:47:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162463#p162463</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск строки в текстовом файле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162462#p162462" />
			<content type="html"><![CDATA[<p>А какие части строки наверняка будут постоянными?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2025-05-10T10:38:06Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162462#p162462</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск строки в текстовом файле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162461#p162461" />
			<content type="html"><![CDATA[<p>Еще 1 вопрос, как можно реализовать, что-бы не только по шаблону искал, к примеру если текст будет меняться.</p><p>Пример:<br />[21:02:25] ваши очки: 5.0, id [123]<br />[22:08:26] Данные:&nbsp; ваши очки: 3.0, ид [124]<br />[23:09:29] Данные: очки: 4.0, ваш ид [125]</p>]]></content>
			<author>
				<name><![CDATA[FeklaLvovna]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=44749</uri>
			</author>
			<updated>2025-05-10T04:14:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162461#p162461</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск строки в текстовом файле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162460#p162460" />
			<content type="html"><![CDATA[<p>Благодарю работает, то что надо.</p>]]></content>
			<author>
				<name><![CDATA[FeklaLvovna]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=44749</uri>
			</author>
			<updated>2025-05-10T03:15:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162460#p162460</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск строки в текстовом файле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162459#p162459" />
			<content type="html"><![CDATA[<p>Попробуйте так:<br /></p><div class="codebox"><pre><code>FileRead, text, C:\test.txt
MsgBox % text ; убедитесь, что нет проблем с кодировкой кириллицы
min := 0xFFFFFFFF
id := &quot;&quot;
while RegExMatch(text, &quot;`amO)^Очки: ([\d.]+), id \[(\d+)]$&quot;, m, m ? m.Pos + 1 : 1) {
    if (m[1] + 0 &lt; min) {
        min := m[1] + 0
        id := m[2]
    }
}
MsgBox % id</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2025-05-10T00:10:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162459#p162459</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Поиск строки в текстовом файле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162458#p162458" />
			<content type="html"><![CDATA[<p>Приветствую, как найти в текстовом файле строку с минимальным значением очков и скопировать значение id найденной строки, без квадратных скобок.</p><p>Должно быть так:<br />5.2 124</p><p>Текстовый файл:<br />Очки: 10.1, id [123]<br />Очки: 5.2, id [124]<br />Очки: 8.3, id [125]</p><div class="codebox"><pre><code>
txt = C:\test.txt

Loop, read, %txt%
{
ifinstring, A_LoopReadLine, Очки: 
RegExMatch(A_LoopReadLine, &quot;([0-9]+\.[0-9]+)&quot;, a)
ifinstring, A_LoopReadLine, Очки: 
RegExMatch(A_LoopReadLine, &quot;[[0-9]+]&quot;, n)
}
Msgbox %n%
Return
</code></pre></div><p>Скрипт копирует последнюю строку.</p>]]></content>
			<author>
				<name><![CDATA[FeklaLvovna]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=44749</uri>
			</author>
			<updated>2025-05-09T03:29:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162458#p162458</id>
		</entry>
</feed>
