<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; CMD/BAT: вывести первые 5 строк txt-файла]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=14270&amp;type=atom" />
	<updated>2018-10-21T16:40:39Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=14270</id>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: вывести первые 5 строк txt-файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129342#p129342" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>@echo off
setlocal enableextensions enabledelayedexpansion

set sSourceFile=C:\Мои проекты\0212\Source.txt
set /a iCount = 5

if exist &quot;%sSourceFile%&quot; (
	&lt;&quot;%sSourceFile%&quot; (
		for /l %%i in (1, 1, %iCount%) do (
			set sVar=
			&gt;nul set /p sVar=
			echo.!sVar!
		)
	)
) else (
	echo Can&#039;t find source file [%sSourceFile%].
	exit /b 1
)

endlocal
exit /b 0
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2018-10-21T16:40:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129342#p129342</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[CMD/BAT: вывести первые 5 строк txt-файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129341#p129341" />
			<content type="html"><![CDATA[<p>НЕ могу выполнить задание. Суть заключается, как я уже писал в заголовке, в том, что нужно вывести первые 5 (или n) строк текстового файла, а результат выводился в командной строке. Помогите пожалуйста.</p>]]></content>
			<author>
				<name><![CDATA[AmatarYI]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39596</uri>
			</author>
			<updated>2018-10-21T16:32:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129341#p129341</id>
		</entry>
</feed>
