<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; CMD/BAT: Вытащить строки]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=14177&amp;type=atom" />
	<updated>2018-09-20T14:58:22Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=14177</id>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Вытащить строки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128789#p128789" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>@echo off
setlocal enableextensions enabledelayedexpansion

set /a iCount = 7
set sPattern1=
for /l %%i in (1, 1, %iCount%) do set sPattern1=!sPattern1!.

set sPattern2=[A-Za-z0-9А-Яа-яЁё]
set sSourceFile=C:\Мои проекты\0198\Source file.txt

if exist &quot;%sSourceFile%&quot; (
	&gt;nul chcp 1251
	&gt;&quot;NewFile.txt&quot; (
		type &quot;%sSourceFile%&quot; | 2&gt;nul findstr.exe /e /r /i /c:&quot;:%sPattern1%&quot; | 2&gt;nul findstr.exe /r /i /c:&quot;%sPattern2%&quot;
	)
	&gt;&quot;OtherStrings.txt&quot; (
		type &quot;%sSourceFile%&quot; | 2&gt;nul findstr.exe /v /b /e /l /g:&quot;NewFile.txt&quot;
	)
	&gt;nul chcp 866
) else (
	echo Can&#039;t find source file [%sSourceFile%].
	exit /b 1
)

endlocal
exit /b 0
</code></pre></div><p>iCount — это Ваше число «N символов».</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2018-09-20T14:58:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128789#p128789</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Вытащить строки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128785#p128785" />
			<content type="html"><![CDATA[<p><strong>alexii</strong>Добрый день, прошу прощения, я не правильный образец файла скинул. Строки должны быть в формате:<br />&quot;login@mail.ru:qwe7rty<br />asd@yandex.ru:123456789qwer&quot;</p><p>И нужно получить те строки, где то, что после &quot;:&quot; состоит из N символов и содержит хотя бы одну букву и одну цифру.<br />Помогите, пожалуйста</p>]]></content>
			<author>
				<name><![CDATA[feyk55555]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39534</uri>
			</author>
			<updated>2018-09-20T10:10:28Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128785#p128785</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Вытащить строки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128784#p128784" />
			<content type="html"><![CDATA[<p>И выводить полностью строку, в которой после &quot;:&quot; соответствует, а в другой файл полностью строку, которая не соответствует</p>]]></content>
			<author>
				<name><![CDATA[feyk55555]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39534</uri>
			</author>
			<updated>2018-09-20T09:43:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128784#p128784</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Вытащить строки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128783#p128783" />
			<content type="html"><![CDATA[<p><strong>alexii</strong><br />Прошу прощения, я не правильно написал. Нужно из такой базы то, что после &quot;:&quot; проверять (7 символов, не менее 1 буквы и не менее 1 цифры)<br />https://dropmefiles.com/WE7ao</p>]]></content>
			<author>
				<name><![CDATA[feyk55555]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39534</uri>
			</author>
			<updated>2018-09-20T09:32:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128783#p128783</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Вытащить строки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128775#p128775" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>@echo off
setlocal enableextensions enabledelayedexpansion

set sPattern=[A-Za-z0-9А-Яа-яЁё]

&gt;nul chcp 1251
&gt;&quot;NewFile.txt&quot; (
	type &quot;123.txt&quot; | findstr.exe /b /e /r /i /c:&quot;.............&quot; | findstr.exe /r /i /c:&quot;%sPattern%&quot;
)
&gt;&quot;OtherStrings.txt&quot; (
	type &quot;123.txt&quot; | findstr.exe /v /b /e /l /g:&quot;NewFile.txt&quot;
)
&gt;nul chcp 866

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-09-19T18:24:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128775#p128775</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Вытащить строки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128772#p128772" />
			<content type="html"><![CDATA[<p>Не совсем понял код и не получается сделать вывод в новый файл. А ещё остальные нужно в другой файл</p>]]></content>
			<author>
				<name><![CDATA[feyk55555]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39534</uri>
			</author>
			<updated>2018-09-19T18:02:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128772#p128772</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Вытащить строки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128771#p128771" />
			<content type="html"><![CDATA[<p><strong>feyk55555</strong>, Вы на какие свои вопросы отвечаете, мною не заданные. А мои большей частью игнорируете.</p><p>Вот Вам образец кода:<br /></p><div class="codebox"><pre><code>@echo off
setlocal enableextensions enabledelayedexpansion

&gt;nul chcp 1251
type &quot;123.txt&quot; | findstr.exe /r /i /c:&quot;^.............$&quot; | findstr.exe /r /i /c:&quot;[A-Za-z0-9А-Яа-яЁё]&quot;
&gt;nul chcp 866

endlocal
exit /b 0
</code></pre></div><p>Первым findstr.exe отбираются строки длиной «13 символов», вторым — содержащие «хотя бы одна буква и одна цифра».</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2018-09-19T17:48:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128771#p128771</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Вытащить строки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128770#p128770" />
			<content type="html"><![CDATA[<p>1- https://dropmefiles.com/WN24d , не учитывая пробелы<br />2- Количество символов строки необходимо указывать в bat-файле, латиница(в приоритете) и кириллица<br />3- ?</p>]]></content>
			<author>
				<name><![CDATA[feyk55555]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39534</uri>
			</author>
			<updated>2018-09-19T16:59:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128770#p128770</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Вытащить строки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128769#p128769" />
			<content type="html"><![CDATA[<p>Упакуйте образец файла в архив, выложите на <a href="https://dropmefiles.com/">DropMeFiles</a>.</p><p>1. Ровно 13 символов? Учитываются ли в этом количестве символы конца строки? Или нет?<br />2. Буквы какие? Только латиница, только кириллица, и то, и другое?<br />3. Почему именно пакетный файл?</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2018-09-19T16:53:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128769#p128769</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[CMD/BAT: Вытащить строки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128768#p128768" />
			<content type="html"><![CDATA[<p>Здравствуйте помогите пожалуйста сделать батник который будет вытаскивать из файла строки, которые содержат 13 символов и среди них есть хотя бы одна буква и одна цифра</p>]]></content>
			<author>
				<name><![CDATA[feyk55555]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39534</uri>
			</author>
			<updated>2018-09-19T16:31:28Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128768#p128768</id>
		</entry>
</feed>
