<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: StringSplit и 4-е подряд пробела.]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=8307</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=8307&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: StringSplit и 4-е подряд пробела.».]]></description>
		<lastBuildDate>Thu, 30 May 2013 11:13:15 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: StringSplit и 4-е подряд пробела.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72565#p72565</link>
			<description><![CDATA[<p>Что думаете по счёт такого варианта?:</p><div class="codebox"><pre><code>
text =
(
sec&quot;    &quot;mA&quot;    &quot;mV
3,2452587890625    -0,00311479461379349    0,854992806911469
3,29225610351563    -0,00306393066421151    0,884990870952606
)


RegExSplit( text, &quot;MyArray&quot;, &quot;    |\R&quot;, &quot;&quot;&quot;&quot;)
loop % MyArray0
    MsgBox,, MyArray%A_Index%, % MyArray%A_Index%
Listvars

RegExSplit( Str, NameArr, Delimiter, OmmitChr := &quot;&quot;)    {
    Local Pos := 1, PrPos := &quot;&quot;
    While (PrPos &lt;&gt; Pos) 
        PrPos := Pos, %NameArr%0 := A_Index - 1
        , Pos := RegExMatch(Str, &quot;S`a)(?&lt;&quot; A_Index &quot;&gt;.*?)(?:&quot; Delimiter &quot;|$)&quot;, %NameArr%, Pos) + StrLen(%NameArr%) 
        , %NameArr%%A_Index% := Trim(%NameArr%%A_Index%, OmmitChr)
}
return
</code></pre></div><p>Тут нет варианта того, что в тексте окажется символ разделителя для StringSplit.<br />Результат эдинтичен применению StringSplit.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Thu, 30 May 2013 11:13:15 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72565#p72565</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: StringSplit и 4-е подряд пробела.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72157#p72157</link>
			<description><![CDATA[<p>Правильно ли я понял что &quot;Chr(9733)&quot; это извлечение символа которого скорее всего небудет в исходной строке, и это:<br /></p><div class="codebox"><pre><code>
text =
(
sec&quot;    &quot;mA&quot;    &quot;mV
3,2452587890625    -0,00311479461379349    0,854992806911469
3,29225610351563    -0,00306393066421151    0,884990870952606
)

text := RegExReplace(text, &quot;`a)(    |\R)&quot;, Chr(29733))

StringSplit StringArr, text, % Chr(29733)
Listvars
Pause
</code></pre></div><p>также верно, как и код выше, и как это:<br /></p><div class="codebox"><pre><code>
text := RegExReplace(text, &quot;`a)(    |\R)&quot;, &quot;¶&quot;)

StringSplit StringArr, text, ¶
</code></pre></div><p>?</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Thu, 16 May 2013 10:56:22 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72157#p72157</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: StringSplit и 4-е подряд пробела.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72118#p72118</link>
			<description><![CDATA[<p>И еще раз спасибо.</p><p>added: гдето на порядок быстрее..или больше.</p>]]></description>
			<author><![CDATA[null@example.com (Mikki)]]></author>
			<pubDate>Tue, 14 May 2013 16:27:20 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72118#p72118</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: StringSplit и 4-е подряд пробела.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72117#p72117</link>
			<description><![CDATA[<p>Согласно рекомендациям из справки.<br /></p><div class="codebox"><pre><code>text =
(
sec&quot;    &quot;mA&quot;    &quot;mV
3,2452587890625    -0,00311479461379349    0,854992806911469
3,29225610351563    -0,00306393066421151    0,884990870952606
)

StringReplace text, text, % &quot;    &quot;, % Chr(9733), 1
StringReplace text, text, `r`n, % Chr(9733), 1
StringReplace text, text, `n, % Chr(9733), 1

StringSplit StringArr, text, % Chr(9733)
Listvars
Pause</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (creature.ws)]]></author>
			<pubDate>Tue, 14 May 2013 16:15:58 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72117#p72117</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: StringSplit и 4-е подряд пробела.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72110#p72110</link>
			<description><![CDATA[<p>ИЗвиняюсь, у меня 1.1.08. Спасибо. Сейчас обновлюсь.</p>]]></description>
			<author><![CDATA[null@example.com (Mikki)]]></author>
			<pubDate>Tue, 14 May 2013 12:34:58 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72110#p72110</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: StringSplit и 4-е подряд пробела.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72109#p72109</link>
			<description><![CDATA[<p>В ByRef ommit := &quot;&quot; не нужно убрать двоеточие. с ним работает аж с ноября 2012.<br /></p><div class="quotebox"><blockquote><p>1.1.09.00 - November 7, 2012<br />Allow optional parameters to be declared with := instead of =, for consistency with variable declarations and expressions.</p></blockquote></div>]]></description>
			<author><![CDATA[null@example.com (creature.ws)]]></author>
			<pubDate>Tue, 14 May 2013 12:28:54 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72109#p72109</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: StringSplit и 4-е подряд пробела.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72108#p72108</link>
			<description><![CDATA[<p>Спасибо большое.</p><p>(в ByRef ommit := &quot;&quot; надо убрать двоеточие. с ним не работает)</p>]]></description>
			<author><![CDATA[null@example.com (Mikki)]]></author>
			<pubDate>Tue, 14 May 2013 12:26:54 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72108#p72108</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: StringSplit и 4-е подряд пробела.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72107#p72107</link>
			<description><![CDATA[<div class="codebox"><pre><code>text =
(
sec&quot;    &quot;mA&quot;    &quot;mV
3,2452587890625    -0,00311479461379349    0,854992806911469
3,29225610351563    -0,00306393066421151    0,884990870952606
)

s := RegExSplit(text, &quot; {4}|\R&quot;)
loop % s.MaxIndex()
    MsgBox % s[A_Index]

RegExSplit(ByRef string, ByRef pattern, ByRef ommit := &quot;&quot;) {
    startPos := 1, EntryList := []

    while matchPos := RegExMatch(string, pattern, match, startPos)
        EntryList.Insert(Trim(SubStr(string, startPos, matchPos - startPos), ommit))
        , startPos := matchPos + (IsObject(match)? match.len : StrLen(match))

    EntryList.Insert(Trim(SubStr(string, startPos), ommit))
    return EntryList
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (creature.ws)]]></author>
			<pubDate>Tue, 14 May 2013 12:02:34 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72107#p72107</guid>
		</item>
		<item>
			<title><![CDATA[AHK: StringSplit и 4-е подряд пробела.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72106#p72106</link>
			<description><![CDATA[<p>Добрый день.<br />Скрипт считывает текстовый файл в переменную, а затем пытается разбить на куски с помощью StringSplit.</p><div class="codebox"><pre><code>Delim=%A_Space%+%A_Space%+%A_Space%+%A_Space%
FileRead, ALL, %SourceFile%
StringSplit, StringArr, ALL , %Delim%</code></pre></div><p> Куски текста (числа), отделены либо 4-мя пробелами либо &quot;концом строки&quot; и &quot;переводом каретки&quot;. Код выше - не работает т.к. пробелы учитывает поштучно, а не 4-е разом. В результате образуется куча пустых переменных.</p><p>Пример считываемого файла:</p><div class="codebox"><pre><code>sec&quot;    &quot;mA&quot;    &quot;mV
3,2452587890625    -0,00311479461379349    0,854992806911469
3,29225610351563    -0,00306393066421151    0,884990870952606
</code></pre></div><p>Спасибо.</p>]]></description>
			<author><![CDATA[null@example.com (Mikki)]]></author>
			<pubDate>Tue, 14 May 2013 11:55:15 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72106#p72106</guid>
		</item>
	</channel>
</rss>
