<?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=14804&amp;type=atom" />
	<updated>2019-05-29T15:29:11Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=14804</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Запись в переменную только последнею строку]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134480#p134480" />
			<content type="html"><![CDATA[<p>Как записывать в документ tx1.txt только последнею найденную строчку.<br /></p><div class="codebox"><pre><code>
Loop, read, C:\lat.log, tx1.txt
{
    if InStr(A_LoopReadLine, &quot;Работа&quot;)
	Last_found := A_LoopReadLine
}

        FileAppend, %Last_found%
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2019-05-29T15:29:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134480#p134480</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Запись в переменную только последнею строку]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134477#p134477" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>log := {str:&quot;&quot;,find:0,num:0}    ,    log.str := []
		FileEncoding, CP0
		Loop, read, C:\lat.log
		log.str.Insert(A_LoopReadLine)    ,log.num := A_Index
		loop 30
			if RegExMatch(log.str[log.num + 1 - A_Index],&quot;Работа&quot;, end_str) and (log.find:=log.num + 1 - A_Index)
				break
		if (end_str != &quot;&quot;) {
			msgbox, % end_str
		} else {
			msgbox, Строка не найдена
		}</code></pre></div><p>Справедливости ради стоит отметить, что в плане потребления ресурсов этот вариант довольно прожорливый, может товарищи поопытнее что получше подскажут.</p>]]></content>
			<author>
				<name><![CDATA[belyankin12]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34408</uri>
			</author>
			<updated>2019-05-29T06:19:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134477#p134477</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Запись в переменную только последнею строку]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134476#p134476" />
			<content type="html"><![CDATA[<p>Здравствуйте!<br />Столкнулся с проблемой.<br />Имеется данный код:<br /></p><div class="codebox"><pre><code>
Loop, read, C:\lat.log, tx1.txt
{
    if InStr(A_LoopReadLine, &quot;Работа&quot;)
        FileAppend, %A_LoopReadLine%`n
}
</code></pre></div><p>Проблема заключается в том, что он находит много строк, где присутствует слово Работа.</p><p>Вопрос:</p><p>Как записывать в документ tx1.txt только последнею найденную строчку?</p>]]></content>
			<author>
				<name><![CDATA[Clannad5]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39853</uri>
			</author>
			<updated>2019-05-29T04:32:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134476#p134476</id>
		</entry>
</feed>
