<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; АНК: Добавить текст  в файл]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=5655&amp;type=atom" />
	<updated>2011-06-24T07:40:14Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=5655</id>
		<entry>
			<title type="html"><![CDATA[Re: АНК: Добавить текст  в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=49388#p49388" />
			<content type="html"><![CDATA[<p>Еще раз спасибо, <strong>teadrinker</strong>!</p>]]></content>
			<author>
				<name><![CDATA[Bobby]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25841</uri>
			</author>
			<updated>2011-06-24T07:40:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=49388#p49388</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: АНК: Добавить текст  в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=49322#p49322" />
			<content type="html"><![CDATA[<p>Считываем текст из файла в переменную с помощью <em>FileRead</em>, проводим разбор, как в примере выше, создаём новый файл из полученного текста (<em>FileAppend</em>).</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2011-06-22T17:38:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=49322#p49322</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: АНК: Добавить текст  в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=49306#p49306" />
			<content type="html"><![CDATA[<p>Спасибо, <strong>teadrinker</strong>! Только хотелось бы удалять в текстовом файле.</p>]]></content>
			<author>
				<name><![CDATA[Bobby]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25841</uri>
			</author>
			<updated>2011-06-22T10:12:20Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=49306#p49306</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: АНК: Добавить текст  в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=49305#p49305" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>String =
(
Первая строка
Вторая строка
Третья строка
Четвертая строка
)

; удаляем строчку &quot;Третья строка&quot;
Loop, parse, String, `n, `r
   NewString1 .= A_LoopField = &quot;Третья строка&quot; ? &quot;&quot; : A_LoopField . &quot;`n&quot;
   
; удаляем последний перенос строки, если существует:
NewString1 := RegExReplace(NewString1, &quot;(.*)\R$&quot;, &quot;$1&quot;)  
MsgBox, % NewString1

; удаляем вторую строку
Loop, parse, String, `n, `r
   NewString2 .= A_Index = 2 ? &quot;&quot; : A_LoopField . &quot;`n&quot;
   
; удаляем последний перенос строки, если существует:
NewString2 := RegExReplace(NewString2, &quot;(.*)\R$&quot;, &quot;$1&quot;)  
MsgBox, % NewString2</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2011-06-22T08:15:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=49305#p49305</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: АНК: Добавить текст  в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=49304#p49304" />
			<content type="html"><![CDATA[<p>А как удалить определенную строку, т.е. строку с определенным текстом или номер строки?</p>]]></content>
			<author>
				<name><![CDATA[Bobby]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25841</uri>
			</author>
			<updated>2011-06-22T06:34:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=49304#p49304</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: АНК: Добавить текст  в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=47131#p47131" />
			<content type="html"><![CDATA[<p>Всё оказалось гораздо проще. <span class="bbu">Спасибо!</span> <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[Елена]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24632</uri>
			</author>
			<updated>2011-03-29T17:50:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=47131#p47131</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: АНК: Добавить текст  в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=47113#p47113" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Text =
(
Первая строка
Вторая строка
Третья строка
Четвёртая строка
Пятая строка
)

Sort, Text

MsgBox, %Text%</code></pre></div>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2011-03-29T14:52:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=47113#p47113</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: АНК: Добавить текст  в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=47112#p47112" />
			<content type="html"><![CDATA[<p>Всплыл ещё один подводный камень.<br />Теперь необходимо получившийся файл .txt , Каждую строку отсортировать по&nbsp; алфавиту (строк может быть больше&nbsp; 100) длиною максимум 50 знаков<br />Догадываюсь ,что надо загнать его в переменную (FileRead)и через RegExReplace с ним что-то проделать.<br />Но не могу этого сделать.<br />ПОМОГИТЕ !!!</p>]]></content>
			<author>
				<name><![CDATA[Елена]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24632</uri>
			</author>
			<updated>2011-03-29T14:21:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=47112#p47112</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: АНК: Добавить текст  в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=46928#p46928" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>File = D:\Temp\Stih.txt
Str1 = Я смотрю широкими глазами.
Str2 = В Персии такие ж точно куры,

Loop, Read, %File%
{
    If (PrevLine = Str1) and (A_LoopReadLine != Str1)
        Text .= Str2 . &quot;`n&quot;
    Text .= A_LoopReadLine . &quot;`n&quot;
    PrevLine := A_LoopReadLine
}

FileDelete, %File%
FileAppend, %Text%, %File%

MsgBox, Готово.</code></pre></div>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2011-03-26T15:00:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=46928#p46928</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: АНК: Добавить текст  в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=46926#p46926" />
			<content type="html"><![CDATA[<p>Нет, предыдущую надо оставить как и все одинаковые и после неё дописать.</p>]]></content>
			<author>
				<name><![CDATA[Елена]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24632</uri>
			</author>
			<updated>2011-03-26T14:23:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=46926#p46926</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: АНК: Добавить текст  в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=46919#p46919" />
			<content type="html"><![CDATA[<p>Что значит &quot;выбрать последнюю строку&quot;? Предыдущие убрать или оставить?</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2011-03-26T09:16:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=46919#p46919</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: АНК: Добавить текст  в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=46918#p46918" />
			<content type="html"><![CDATA[<p>Это последняя ситуация какая может быть</p>]]></content>
			<author>
				<name><![CDATA[Елена]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24632</uri>
			</author>
			<updated>2011-03-26T09:10:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=46918#p46918</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: АНК: Добавить текст  в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=46917#p46917" />
			<content type="html"><![CDATA[<p>Странная какая-то ситуация. Какой во всём этом смысл? И какие ещё бывают ситуации? Просто неохота зря код писать.</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2011-03-26T09:08:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=46917#p46917</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: АНК: Добавить текст  в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=46913#p46913" />
			<content type="html"><![CDATA[<p>Ещё раз спасибо &quot;YMP&quot; всё работает , но бывает такая ситуация, когда строка повторяется несколько раз(Я смотрю широкими глазами.), и надо выбрать последнюю&nbsp; строку(Я смотрю широкими глазами.) и после неё добавить строчку - <em>В Персии такие ж точно куры,</em> т.е 6 стр</p><p><em>Тихий ветер. Вечер сине-хмурый.<br />Я смотрю широкими глазами.<br />Я смотрю широкими глазами.<br />Я смотрю широкими глазами.<br />Я смотрю широкими глазами.<br />Как у нас в соломенной Рязани.</em></p>]]></content>
			<author>
				<name><![CDATA[Елена]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24632</uri>
			</author>
			<updated>2011-03-26T08:30:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=46913#p46913</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: АНК: Добавить текст  в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=46912#p46912" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>File = D:\Temp\Stih.txt
Str = В Персии такие ж точно куры,

Loop, Read, %File%
{
    If A_Index = 3
        Text .= Str . &quot;`n&quot;
    Text .= A_LoopReadLine . &quot;`n&quot;
}

FileDelete, %File%
FileAppend, %Text%, %File%

MsgBox, Готово.</code></pre></div>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2011-03-26T08:16:09Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=46912#p46912</id>
		</entry>
</feed>
