<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Удаление первой (header) и последней строк после Loop, Parse]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=18278&amp;type=atom" />
	<updated>2024-08-19T03:59:36Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=18278</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удаление первой (header) и последней строк после Loop, Parse]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=161440#p161440" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Попробуйте так:<br /></p><div class="codebox"><pre><code>newContent := RegExReplace(CSV, &quot;^\V+\R|\s*$&quot;)
MsgBox % &quot;|&quot; . newContent . &quot;|&quot;</code></pre></div></blockquote></div><p>Таким образом он удаляет нужную последнюю (пустую) строку, но вместе с предпоследней. Пробовал разное расположение вашего кода в своем.<br />Возможно неверно разместил его у себя.</p><p>Нашел подобный случай на одном из форумов. Один из предложенных вариантов удачно подошел для решения текущего вопроса. </p><div class="codebox"><pre><code>CSV := &quot;&gt;&gt;&quot; rtrim(CSV,&quot; `n`r`t&quot;) &quot;&lt;&lt;&quot;</code></pre></div><p>В любом случае, спасибо за помощь!</p>]]></content>
			<author>
				<name><![CDATA[AbbasParva]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43998</uri>
			</author>
			<updated>2024-08-19T03:59:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=161440#p161440</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удаление первой (header) и последней строк после Loop, Parse]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=161430#p161430" />
			<content type="html"><![CDATA[<p>Попробуйте так:<br /></p><div class="codebox"><pre><code>newContent := RegExReplace(CSV, &quot;^\V+\R|\s*$&quot;)
MsgBox % &quot;|&quot; . newContent . &quot;|&quot;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2024-08-18T15:48:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=161430#p161430</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удаление первой (header) и последней строк после Loop, Parse]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=161428#p161428" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Ой, не уточнил - количество строк всегда разное.<br />Upd. Такой вариант не сработал.<br /></p><div class="codebox"><pre><code>if (A_Index = -1)
continue
StringSplit, headerElements, A_LoopReadLine, `,</code></pre></div><p>Upd. Вариант с созданием копии .csv-файла и удалением крайне (пустой) строки очень не удобен.</p>]]></content>
			<author>
				<name><![CDATA[AbbasParva]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43998</uri>
			</author>
			<updated>2024-08-18T14:45:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=161428#p161428</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удаление первой (header) и последней строк после Loop, Parse]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=161416#p161416" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>AbbasParva пишет:</cite><blockquote><p>Upd. Вопрос с удалением первой строки (header) удалось разрешить с помощью:</p></blockquote></div><p>А с шестой так же не получится?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2024-08-18T09:13:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=161416#p161416</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Удаление первой (header) и последней строк после Loop, Parse]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=161414#p161414" />
			<content type="html"><![CDATA[<p>Всем привет! </p><p>Переношу данные из .csv-файла в гугл-таблицу используя:<br /></p><div class="codebox"><pre><code>Fileread, CSV, *t *p65001 %A_ScriptDir%\users.csv
Loop, Parse, CSV, `n, `r,</code></pre></div><p>На скриншоте структура .csv-файла открытая в Notepad++<br /><a href="https://post-images.org/photo-page.php?photo=5RbQhc1E">https://post-images.org/photo-page.php?photo=5RbQhc1E</a></p><p>Хотелось бы понять как можно указать скрипту удалить первую (header) и шестую (пустую) строки, т.к. они также переносятся при копировании.<br />Подскажите, пожалуйста, куда в данном случае копать?</p><p><em>Upd. Вопрос с удалением первой строки (header) удалось разрешить с помощью:</em><br /></p><div class="codebox"><pre><code>Loop, Parse, CSV, `n, `r,
{
if (A_Index = 1)
continue
StringSplit, headerElements, A_LoopReadLine, `,</code></pre></div>]]></content>
			<author>
				<name><![CDATA[AbbasParva]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43998</uri>
			</author>
			<updated>2024-08-18T05:33:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=161414#p161414</id>
		</entry>
</feed>
