<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Linux Forum &mdash; Как склеить файлы построчно]]></title>
	<link rel="self" href="https://linuxforum.ru/extern.php?action=feed&amp;tid=14233&amp;type=atom" />
	<updated>2011-06-18T00:44:14Z</updated>
	<generator>PunBB</generator>
	<id>https://linuxforum.ru/viewtopic.php?id=14233</id>
		<entry>
			<title type="html"><![CDATA[Re: Как склеить файлы построчно]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=188779#p188779" />
			<content type="html"><![CDATA[<p>Чтобы не создавать новую тему, спрошу здесь.<br />Как перемешать строки файла с кириллицей?</p><p>Если строки англ., то работает прекрасно <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">sort -R</div>. А вот в случае кириллицы такая конструкция сортирует, вместо рандомной перемешки.</p><p>Опять таки нашел сам <img src="https://linuxforum.ru/img/smilies/ab.gif" alt="ab" /></p><p>cat file|awk &#039;{print rand()&quot;\t&quot;$0}&#039;|sort|awk -F&#039;\t&#039; &#039;{print $2}&#039;</p>]]></content>
			<author>
				<name><![CDATA[valet]]></name>
				<uri>https://linuxforum.ru/profile.php?id=13273</uri>
			</author>
			<updated>2011-06-18T00:44:14Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=188779#p188779</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Как склеить файлы построчно]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=188778#p188778" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>drBatty пишет:</cite><blockquote><p>sed &#039;R file2&#039; file1</p></blockquote></div><p>Так получается разрыв между строчками.<br /></p><div class="codebox"><pre><code>строка1file1
строка1file2
строка2file1
строка2file2
...
строкаnfile1
строкаnfile2</code></pre></div><p>И кстати как поступить, если 3 или больше файлов. А вообще интересно, как работает эта конструкция, не могли бы объяснить?</p>]]></content>
			<author>
				<name><![CDATA[valet]]></name>
				<uri>https://linuxforum.ru/profile.php?id=13273</uri>
			</author>
			<updated>2011-06-18T00:35:11Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=188778#p188778</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Как склеить файлы построчно]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=186585#p186585" />
			<content type="html"><![CDATA[<p><strong>valet</strong>, sed &#039;R file2&#039; file1</p>]]></content>
			<author>
				<name><![CDATA[drBatty]]></name>
				<uri>https://linuxforum.ru/profile.php?id=86</uri>
			</author>
			<updated>2011-06-10T07:27:43Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=186585#p186585</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Как склеить файлы построчно]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=186015#p186015" />
			<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">paste --delimiters=&#039;&#039; file1 file2 &gt; file3</div></p><p>Тему можно закрывать.</p>]]></content>
			<author>
				<name><![CDATA[valet]]></name>
				<uri>https://linuxforum.ru/profile.php?id=13273</uri>
			</author>
			<updated>2011-06-07T21:52:13Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=186015#p186015</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Как склеить файлы построчно]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=186013#p186013" />
			<content type="html"><![CDATA[<p>Есть скажем 2 файла, в каждом по 100 строк например.</p><p>Как приклеить каждую строку одного файла с соответствующей строкой другого?<br />То есть например<br />в file1<br /></p><div class="codebox"><pre><code>строка1file1
строка2file1
...
строкаnfile1</code></pre></div><p>в file2<br /></p><div class="codebox"><pre><code>строка1file2
строка2file2
...
строкаnfile2</code></pre></div><p>В file3 хочу получить:<br /></p><div class="codebox"><pre><code>строка1file1строка1file2
строка2file1строка2file2
...
строкаnfile1строкаnfile2</code></pre></div><p>Знаю что можно как-то через grep или sed сделать, но как?</p><p>Подскажите пожалуйста. Заранее спасибо.</p>]]></content>
			<author>
				<name><![CDATA[valet]]></name>
				<uri>https://linuxforum.ru/profile.php?id=13273</uri>
			</author>
			<updated>2011-06-07T21:35:33Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=186013#p186013</id>
		</entry>
</feed>
