<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: copying file content to memory in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/copying-file-content-to-memory/m-p/4728090#M43073</link>
    <description>&lt;!--!*#--&gt;&amp;gt; what about just using plain old head/tail&lt;BR /&gt;&amp;gt; commands?&lt;BR /&gt;&lt;BR /&gt;Did you try your suggestion before posting&lt;BR /&gt;it?  How well did it work for you?&lt;BR /&gt;&lt;BR /&gt;Plain old "head" and "tail" commands can&lt;BR /&gt;extract parts of one file, but it may not be&lt;BR /&gt;immediately clear how you assemble the&lt;BR /&gt;pieces.  (Even if you do get the right&lt;BR /&gt;pieces.)&lt;BR /&gt;&lt;BR /&gt;And, of course, I seem to have reversed the&lt;BR /&gt;roles of "A" and "B" in my example, if I&lt;BR /&gt;understand the original question (which I&lt;BR /&gt;don't claim to do).</description>
    <pubDate>Tue, 21 Dec 2010 13:04:57 GMT</pubDate>
    <dc:creator>Steven Schweda</dc:creator>
    <dc:date>2010-12-21T13:04:57Z</dc:date>
    <item>
      <title>copying file content to memory</title>
      <link>https://community.hpe.com/t5/operating-system-linux/copying-file-content-to-memory/m-p/4728087#M43070</link>
      <description>Hi there &lt;BR /&gt;How can I copy a text-file content to the memory without editing the file ?&lt;BR /&gt;For example there is 12000 lines of text in file "A" and I want to copy and paste all of it to file "B" between line 1 and 3 ?&lt;BR /&gt;Is there any way of doing that without manually copying all the 12000 lines ?</description>
      <pubDate>Sat, 18 Dec 2010 00:26:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/copying-file-content-to-memory/m-p/4728087#M43070</guid>
      <dc:creator>Piotr Kirklewski</dc:creator>
      <dc:date>2010-12-18T00:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: copying file content to memory</title>
      <link>https://community.hpe.com/t5/operating-system-linux/copying-file-content-to-memory/m-p/4728088#M43071</link>
      <description>&lt;!--!*#--&gt;&amp;gt; How can I copy a text-file content to the&lt;BR /&gt;&amp;gt; memory without editing the file ?&lt;BR /&gt;&lt;BR /&gt;By "to the memory", do you mean "to another&lt;BR /&gt;file"?&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] between line 1 and 3 ?&lt;BR /&gt;&lt;BR /&gt;What did you want to do with line 2, which is&lt;BR /&gt;currently between lines 1 and 3?&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Is there any way of doing that [...]&lt;BR /&gt;&lt;BR /&gt;Depending on exactly what "that" is, there&lt;BR /&gt;are probably several ways.  Here's a crude&lt;BR /&gt;way of doing something:&lt;BR /&gt;&lt;BR /&gt;      man cat&lt;BR /&gt;      man sed&lt;BR /&gt;&lt;BR /&gt;      M=2&lt;BR /&gt;      N=3&lt;BR /&gt;      ( sed -n -e "1,${M}p" A ; cat B ; sed -n -e "${N},\$p" A )&lt;BR /&gt;&lt;BR /&gt;For example:&lt;BR /&gt;&lt;BR /&gt;alp$ cat A&lt;BR /&gt;File A line 1.&lt;BR /&gt;File A line 2.&lt;BR /&gt;File A line 3.&lt;BR /&gt;File A line 4.&lt;BR /&gt;&lt;BR /&gt;alp$ cat B&lt;BR /&gt;File B line 1.&lt;BR /&gt;File B line 2.&lt;BR /&gt;File B line 3.&lt;BR /&gt;File B line 4.&lt;BR /&gt;&lt;BR /&gt;alp$ sed -n -e "1,${M}p" A&lt;BR /&gt;File A line 1.&lt;BR /&gt;File A line 2.&lt;BR /&gt;&lt;BR /&gt;alp$ sed -n -e "${N},\$p" A&lt;BR /&gt;File A line 3.&lt;BR /&gt;File A line 4.&lt;BR /&gt;&lt;BR /&gt;alp$ ( sed -n -e "1,${M}p" A ; cat B ; sed -n -e "${N},\$p" A )&lt;BR /&gt;File A line 1.&lt;BR /&gt;File A line 2.&lt;BR /&gt;File B line 1.&lt;BR /&gt;File B line 2.&lt;BR /&gt;File B line 3.&lt;BR /&gt;File B line 4.&lt;BR /&gt;File A line 3.&lt;BR /&gt;File A line 4.&lt;BR /&gt;</description>
      <pubDate>Sat, 18 Dec 2010 03:54:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/copying-file-content-to-memory/m-p/4728088#M43071</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-12-18T03:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: copying file content to memory</title>
      <link>https://community.hpe.com/t5/operating-system-linux/copying-file-content-to-memory/m-p/4728089#M43072</link>
      <description>what about just using plain old head/tail commands?&lt;BR /&gt;&lt;BR /&gt;head -2 file_a | tail -n 1 &amp;gt;&amp;gt; file_b</description>
      <pubDate>Tue, 21 Dec 2010 07:55:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/copying-file-content-to-memory/m-p/4728089#M43072</guid>
      <dc:creator>dirk dierickx</dc:creator>
      <dc:date>2010-12-21T07:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: copying file content to memory</title>
      <link>https://community.hpe.com/t5/operating-system-linux/copying-file-content-to-memory/m-p/4728090#M43073</link>
      <description>&lt;!--!*#--&gt;&amp;gt; what about just using plain old head/tail&lt;BR /&gt;&amp;gt; commands?&lt;BR /&gt;&lt;BR /&gt;Did you try your suggestion before posting&lt;BR /&gt;it?  How well did it work for you?&lt;BR /&gt;&lt;BR /&gt;Plain old "head" and "tail" commands can&lt;BR /&gt;extract parts of one file, but it may not be&lt;BR /&gt;immediately clear how you assemble the&lt;BR /&gt;pieces.  (Even if you do get the right&lt;BR /&gt;pieces.)&lt;BR /&gt;&lt;BR /&gt;And, of course, I seem to have reversed the&lt;BR /&gt;roles of "A" and "B" in my example, if I&lt;BR /&gt;understand the original question (which I&lt;BR /&gt;don't claim to do).</description>
      <pubDate>Tue, 21 Dec 2010 13:04:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/copying-file-content-to-memory/m-p/4728090#M43073</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-12-21T13:04:57Z</dc:date>
    </item>
  </channel>
</rss>

