<?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="http://forum.script-coding.com/extern.php?action=feed&amp;tid=12883&amp;type=atom" />
	<updated>2017-09-18T19:13:02Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=12883</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обработка текстового документа.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=119417#p119417" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong> Догнал. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br /></p><div class="codebox"><pre><code>For k, v in Arr
   res .= A_Index &quot;. &quot; k &quot; - &quot; v &quot;`n&quot;
MsgBox % res</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Vicoriyan]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=38658</uri>
			</author>
			<updated>2017-09-18T19:13:02Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=119417#p119417</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обработка текстового документа.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=119416#p119416" />
			<content type="html"><![CDATA[<p><strong>Vicoriyan</strong>, ну а из чего по-вашему получается итоговая строка res?</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-09-18T18:57:20Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=119416#p119416</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обработка текстового документа.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=119415#p119415" />
			<content type="html"><![CDATA[<p><strong>stealzy</strong> Все равно не понял где.</p>]]></content>
			<author>
				<name><![CDATA[Vicoriyan]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=38658</uri>
			</author>
			<updated>2017-09-18T18:29:56Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=119415#p119415</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обработка текстового документа.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=119408#p119408" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Vicoriyan пишет:</cite><blockquote><p>Куда следует поставить A_Index, что бы шла нумерация строк</p></blockquote></div><p>Вероятно в начало строки, из вариаций которой склеивается итоговая строка(ваш К.О.).</p>]]></content>
			<author>
				<name><![CDATA[stealzy]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=31937</uri>
			</author>
			<updated>2017-09-18T15:59:27Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=119408#p119408</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обработка текстового документа.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=119404#p119404" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong> Куда следует поставить A_Index, что бы шла нумерация строк. На примере это выглядит так:</p><p>1. 0xFF0146BF - 980<br />2. 0xFFDBA51E - 220<br />3. 0xFF002F87 - 198<br />4. 0xFF181822 - 102<br />5. 0xFF8B99A6 - 98<br />6. 0xFFE66B70 - 52<br />7. 0xFF7D1F2D - 44<br />8. 0xFF5D9CEC - 24<br />9. 0xFF00469E - 11<br />10. 0xFFFFFEFF - 10<br />11. 0xFF145348 - 7<br />12. 0xFF006756 - 1<br />13. 0xFF871423 - 1<br />И так далее.</p>]]></content>
			<author>
				<name><![CDATA[Vicoriyan]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=38658</uri>
			</author>
			<updated>2017-09-18T10:23:16Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=119404#p119404</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обработка текстового документа.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=118823#p118823" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>SetBatchLines, -1
CoordMode, Pixel, screen
pToken := Gdip_Startup()
pBitmap := Gdip_BitmapFromScreen()
width := Gdip_GetImageWidth(pBitmap)
height := Gdip_GetImageHeight(pBitmap)
Gdip_LockBits(pBitmap, 0, 0, width, height, Stride, Scan0, BitmapData)
Arr:={}
loop % width
{
   A_Index_X := A_Index-1
   loop % height
   {
      CurrentPixel := Gdip_GetLockBitPixel(Scan0, A_Index_X, A_Index-1, Stride)
      If Arr.HasKey(&quot;&quot; CurrentPixel)
         ++Arr[&quot;&quot; CurrentPixel]
      Else
         Arr[&quot;&quot; CurrentPixel]:=1
   }
}
Gdip_UnlockBits(pBitmap, BitmapData)
Gdip_DisposeImage(pBitmap)
Gdip_Shutdown(pToken)
For k, v in Arr
   res .= k &quot; - &quot; v &quot;`n&quot;
MsgBox % res</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-08-26T18:22:00Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=118823#p118823</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обработка текстового документа.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=118822#p118822" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong> есть картинка например 50х50. В этой картинке 2500 пикселей. Мне нужно, чтоб скрипт проанализировал сколько шт пикселей того или иного цвета есть на этой картинке. Результат должен выглядеть так:<br />0xFF0146BF - 980<br />0xFFDBA51E - 220<br />0xFF002F87 - 198<br />0xFF181822 - 102<br />0xFF8B99A6 - 98<br />0xFFE66B70 - 52<br />0xFF7D1F2D - 44<br />0xFF5D9CEC - 24<br />0xFF00469E - 11<br />0xFFFFFEFF - 10<br />0xFF145348 - 7<br />0xFF006756 - 1<br />0xFF871423 - 1<br />И так далее.</p>]]></content>
			<author>
				<name><![CDATA[Vicoriyan]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=38658</uri>
			</author>
			<updated>2017-08-26T17:59:56Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=118822#p118822</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обработка текстового документа.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=118821#p118821" />
			<content type="html"><![CDATA[<p>Мне лично непонятна задача, что имеем и что хотим получить.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-08-26T17:52:08Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=118821#p118821</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обработка текстового документа.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=118819#p118819" />
			<content type="html"><![CDATA[<p><strong>serzh82saratov</strong> Долго в плане обработки пикселей или для поиска самого решения? А вопрос наверное нельзя дублировать в другой теме. Если уж задал тут, может кто поможет.</p>]]></content>
			<author>
				<name><![CDATA[Vicoriyan]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=38658</uri>
			</author>
			<updated>2017-08-26T17:03:35Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=118819#p118819</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обработка текстового документа.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=118818#p118818" />
			<content type="html"><![CDATA[<p>Можете наверное, но это очень долго, я бы искал решение в вашей теме про пиксели.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2017-08-26T16:43:07Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=118818#p118818</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обработка текстового документа.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=118815#p118815" />
			<content type="html"><![CDATA[<p><strong>serzh82saratov</strong> Могу ли я применить Ваш скрипт для определения, сколько раз встречается тот или иной пиксель в выделенной области?<br />Пиксели ищем с помощью этого скрипта:<br /></p><div class="codebox"><pre><code>
SetBatchLines, -1
CoordMode, Pixel, screen
pixelArray := []
pToken := Gdip_Startup()
pBitmap := Gdip_BitmapFromScreen(&quot;100|0|10|10&quot;)
width := Gdip_GetImageWidth(pBitmap)
height := Gdip_GetImageHeight(pBitmap)
Gdip_LockBits(pBitmap, 0, 0, width, height, Stride, Scan0, BitmapData)
loop % width
{
   A_Index_X := A_Index-1
   loop % height
   {
      pixelArray[A_Index_X, A_Index-1] := Gdip_GetLockBitPixel(Scan0, A_Index_X, A_Index-1, Stride)
   }
}
Gdip_UnlockBits(pBitmap, BitmapData)
Gdip_DisposeImage(pBitmap)
Gdip_Shutdown(pToken)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Vicoriyan]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=38658</uri>
			</author>
			<updated>2017-08-26T13:50:51Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=118815#p118815</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обработка текстового документа.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117949#p117949" />
			<content type="html"><![CDATA[<p><strong>serzh82saratov</strong><br />Так норм. Ещё раз спасибо!</p>]]></content>
			<author>
				<name><![CDATA[Mox]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=38680</uri>
			</author>
			<updated>2017-08-07T12:07:59Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117949#p117949</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обработка текстового документа.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117947#p117947" />
			<content type="html"><![CDATA[<p>А так?<br /></p><div class="codebox"><pre><code>
cars = cars.txt
FileRead, list, *t %cars%

Loop, Parse, % List . Arr := {}, `n, `r 
	If (A_LoopField ~= &quot;\S+&quot; &amp;&amp; !Arr.HasKey(A_LoopField) &amp;&amp; Arr[A_LoopField] := 1)
		RegExReplace(List, &quot;m`ai)^\Q&quot; A_LoopField &quot;\E$&quot;, &quot;&quot;, Count) 
		, Res .= A_LoopField &quot; - &quot; Count &quot;`n&quot;

FileDelete, %cars%
FileAppend, %res%, %cars%
msgbox, % res
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2017-08-07T11:04:35Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117947#p117947</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обработка текстового документа.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117946#p117946" />
			<content type="html"><![CDATA[<p>Всё ровно какая-то фигня.<br />Содержимое .txt файла:<br /></p><div class="codebox"><pre><code>
a
a

aa
a
aaa
aa
a

aaa

</code></pre></div><p>Скрипт, который я слепил:<br /></p><div class="codebox"><pre><code>
cars = cars.txt
Arr:={}
FileRead, list, %cars%
list := RegExReplace(List, &quot;\R\s*(?=\R)&quot;)
Loop, parse, list, `n, `r
	If Arr.HasKey(A_LoopField)
		++Arr[A_LoopField]
	Else
		Arr[A_LoopField]:=1

For k, v in Arr
	res .= k &quot; - &quot; v &quot;`n&quot;
FileDelete, %cars%
FileAppend, %res%, %cars%
msgbox, % res
</code></pre></div><p>Он удаляет все пустые строки в промежутках, но всё ровно в конце одна не удаляется... и он её считает. И выдаёт:<br /></p><div class="codebox"><pre><code>
 - 1
a - 4
aa - 2
aaa - 2
</code></pre></div><p>Как это пофиксить?</p>]]></content>
			<author>
				<name><![CDATA[Mox]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=38680</uri>
			</author>
			<updated>2017-08-07T10:59:44Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117946#p117946</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обработка текстового документа.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117942#p117942" />
			<content type="html"><![CDATA[<p><strong>serzh82saratov</strong><br />Вкурил. Спасибо огромное.</p>]]></content>
			<author>
				<name><![CDATA[Mox]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=38680</uri>
			</author>
			<updated>2017-08-07T09:40:28Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117942#p117942</id>
		</entry>
</feed>
