<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Linux Forum &mdash; Задача по grep]]></title>
	<link rel="self" href="https://linuxforum.ru/extern.php?action=feed&amp;tid=22733&amp;type=atom" />
	<updated>2012-06-11T01:24:10Z</updated>
	<generator>PunBB</generator>
	<id>https://linuxforum.ru/viewtopic.php?id=22733</id>
		<entry>
			<title type="html"><![CDATA[Re: Задача по grep]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=281252#p281252" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Fat-Zer пишет:</cite><blockquote><div class="quotebox"><cite>valet пишет:</cite><blockquote><p>cat -A used_accs.txt</p></blockquote></div><p>виндовый файл - в этом и проблема... <br />прогоните через dos2unix. ну или ещё какую-нить утилитку, которая умеет менять концы строк.<br />[added]<br />ну или как-то так:<br /><strong>sed &#039;s/\r$//&#039; used_accs.txt | grep -v -f - all_accs.txt</strong></p></blockquote></div><p>Да, спасибо. Так работает. Файл действительно виндовый, он создается виндовой прогой, вот она и ставит эти окончания.</p>]]></content>
			<author>
				<name><![CDATA[valet]]></name>
				<uri>https://linuxforum.ru/profile.php?id=13273</uri>
			</author>
			<updated>2012-06-11T01:24:10Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=281252#p281252</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Задача по grep]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=281250#p281250" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>valet пишет:</cite><blockquote><p>cat -A used_accs.txt</p></blockquote></div><p>виндовый файл - в этом и проблема... <br />прогоните через dos2unix. ну или ещё какую-нить утилитку, которая умеет менять концы строк.<br />[added]<br />ну или как-то так:<br /><strong>sed &#039;s/\r$//&#039; used_accs.txt | grep -v -f - all_accs.txt</strong></p>]]></content>
			<author>
				<name><![CDATA[Fat-Zer]]></name>
				<uri>https://linuxforum.ru/profile.php?id=11911</uri>
			</author>
			<updated>2012-06-11T00:49:27Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=281250#p281250</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Задача по grep]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=281249#p281249" />
			<content type="html"><![CDATA[<p>cat -A used_accs.txt <br />modistonev2010@list.ru^M$<br />dounarax2011@mail.ru^M$<br />mirinc2010@bk.ru^M$<br />dairimg2011@mail.ru^M$<br />pureml1985@bk.ru^M$<br />meztiwoodg2011@inbox.ru^M$<br />fearlesstiust1989@inbox.ru^M$</p><p>cat -A all_accs.txt <br />dounarax2011@mail.ru:qnwifvryyitsbsk$<br />peshadee2010@inbox.ru:sgmlweildpelcsi$<br />kirimu2011@inbox.ru:wudptypekeaahsd$<br />tygrastaffl1981@mail.ru:bgagdyupfulymjn$<br />tonradl2011@list.ru:erfhkurxsxvwisd$<br />burilaks2011@list.ru:xwdftijsxhbirmk$</p>]]></content>
			<author>
				<name><![CDATA[valet]]></name>
				<uri>https://linuxforum.ru/profile.php?id=13273</uri>
			</author>
			<updated>2012-06-11T00:33:42Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=281249#p281249</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Задача по grep]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=281248#p281248" />
			<content type="html"><![CDATA[<p>УМВР<br />пользуйте <strong>cat -A &lt;file&gt;</strong> и ищите пробелы на концах строк.</p>]]></content>
			<author>
				<name><![CDATA[Fat-Zer]]></name>
				<uri>https://linuxforum.ru/profile.php?id=11911</uri>
			</author>
			<updated>2012-06-11T00:11:52Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=281248#p281248</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Задача по grep]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=281247#p281247" />
			<content type="html"><![CDATA[<p>Это просто фантастика. Ваш пример работает, мой нет <img src="https://linuxforum.ru/img/smilies/ab.gif" alt="ab" />.</p><p>cat all_accs.txt <br /><strong>dounarax2011@mail.ru:qnwifvryyitsbsk</strong><br />peshadee2010@inbox.ru:sgmlweildpelcsi<br />kirimu2011@inbox.ru:wudptypekeaahsd<br />tygrastaffl1981@mail.ru:bgagdyupfulymjn<br />tonradl2011@list.ru:erfhkurxsxvwisd<br />burilaks2011@list.ru:xwdftijsxhbirmk</p><p>cat used_accs.txt <br />modistonev2010@list.ru<br /><strong>dounarax2011@mail.ru</strong><br />mirinc2010@bk.ru<br />dairimg2011@mail.ru<br />pureml1985@bk.ru<br />meztiwoodg2011@inbox.ru<br />fearlesstiust1989@inbox.ru</p><br /><p>Жирным выделил совпадающие.</p><p>cat all_accs.txt | grep -v -f used_accs.txt <br /><strong>dounarax2011@mail.ru:qnwifvryyitsbsk</strong><br />peshadee2010@inbox.ru:sgmlweildpelcsi<br />kirimu2011@inbox.ru:wudptypekeaahsd<br />tygrastaffl1981@mail.ru:bgagdyupfulymjn<br />tonradl2011@list.ru:erfhkurxsxvwisd<br />burilaks2011@list.ru:xwdftijsxhbirmk</p><p>grep -v -f used_accs.txt all_accs.txt <br /><strong>dounarax2011@mail.ru:qnwifvryyitsbsk</strong><br />peshadee2010@inbox.ru:sgmlweildpelcsi<br />kirimu2011@inbox.ru:wudptypekeaahsd<br />tygrastaffl1981@mail.ru:bgagdyupfulymjn<br />tonradl2011@list.ru:erfhkurxsxvwisd</p><br /><p>Выделенная строка лишняя, этот аккаунт имеется в использованных, но тем не менее он выводится.<br />Что я делаю не так?</p>]]></content>
			<author>
				<name><![CDATA[valet]]></name>
				<uri>https://linuxforum.ru/profile.php?id=13273</uri>
			</author>
			<updated>2012-06-10T23:21:10Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=281247#p281247</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Задача по grep]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=281142#p281142" />
			<content type="html"><![CDATA[<p>cat излишен, достаточно<br />$ grep -v -f used_accs.txt all_accs.txt</p>]]></content>
			<author>
				<name><![CDATA[bormant]]></name>
				<uri>https://linuxforum.ru/profile.php?id=732</uri>
			</author>
			<updated>2012-06-10T07:40:30Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=281142#p281142</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Задача по grep]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=281102#p281102" />
			<content type="html"><![CDATA[<p>Да, спасибо. Действительно работает - это я что-то напутал.</p>]]></content>
			<author>
				<name><![CDATA[valet]]></name>
				<uri>https://linuxforum.ru/profile.php?id=13273</uri>
			</author>
			<updated>2012-06-09T17:53:53Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=281102#p281102</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Задача по grep]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=281094#p281094" />
			<content type="html"><![CDATA[<p>Не знаю, правильно ли я вас понял, но...<br /><div class="termtitle" style="font-family: sans-serif; position:relative; height:auto; width:auto; background:#3A4061; color:#FFFFFF; padding: 1px;"><b> Консоль:</b></div>
<div class="termcont" style="font-family: Terminus; position:relative; height:auto; width:auto; overflow-x:scroll; white-space: nowrap ; overflow-y:auto;background:#000000; color:#4EF44E; line-height:1.2; padding: 3px; font-size: 1rem; max-height: 60vh"><br />lupo@gentoo-laptop /tmp % cat all_accs.txt<br />abc:123<br />bcd:234<br />asdf:0987<br />wert:7890<br />lupo@gentoo-laptop /tmp % cat used_accs.txt<br />bcd<br />abc<br />lupo@gentoo-laptop /tmp % cat all_accs.txt | grep -v -f used_accs.txt<br />asdf:0987<br />wert:7890<br /></div></p>]]></content>
			<author>
				<name><![CDATA[Lupo Alberto]]></name>
				<uri>https://linuxforum.ru/profile.php?id=9018</uri>
			</author>
			<updated>2012-06-09T17:00:11Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=281094#p281094</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Задача по grep]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=281086#p281086" />
			<content type="html"><![CDATA[<p>Имеется 2 файла: all_accs.txt и used_accs.txt</p><p>all_accs.txt - файл с аккаунтами в формате: login:pass<br />used_accs.txt - файл с использованными аккаунтами в формате: login</p><p>Нужно выбрать те аккаунты, которые еще не использовались.</p><p>Если бы формат файлов совпадал, то задача решалась бы так:<br /></p><div class="codebox"><pre><code>cat all_accs.txt | grep -vF -f used_accs.txt</code></pre></div><p>Но к сожалению в соответствующих строках между файлами неполное совпадение, совпадают только логины. Подскажите, уважаемые форумчане, <strong>как выбрать строки с одного файла, которые не ищутся по неполном совпадению в другом</strong>?</p>]]></content>
			<author>
				<name><![CDATA[valet]]></name>
				<uri>https://linuxforum.ru/profile.php?id=13273</uri>
			</author>
			<updated>2012-06-09T16:15:56Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=281086#p281086</id>
		</entry>
</feed>
