<?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: read in file in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/read-in-file/m-p/2765526#M894611</link>
    <description>Really Perl is the scripting language of choice for this. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;open F1, "&lt;MYFILE.DAT&gt;&lt;/MYFILE.DAT&gt;$n = read(F1,$s_in,8192);&lt;BR /&gt;# $n - number of bytes read&lt;BR /&gt;# $s_in contains the data up to 8192 bytes&lt;BR /&gt;&lt;BR /&gt;# now seek to offset 32768 and read again&lt;BR /&gt;seek(F1,32768,0);&lt;BR /&gt;$n = read(f1,$s_in,8192);&lt;BR /&gt;close F1;&lt;BR /&gt;&lt;BR /&gt;You would, of course, need to add some error checking but this is the clean scripting way to do this.&lt;BR /&gt;</description>
    <pubDate>Wed, 17 Jul 2002 13:26:38 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2002-07-17T13:26:38Z</dc:date>
    <item>
      <title>read in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-in-file/m-p/2765521#M894602</link>
      <description>Is there a way to read a specified number of bytes in&lt;BR /&gt;a file using a script?</description>
      <pubDate>Wed, 17 Jul 2002 04:30:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-in-file/m-p/2765521#M894602</guid>
      <dc:creator>Bhoyet Orillo</dc:creator>
      <dc:date>2002-07-17T04:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: read in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-in-file/m-p/2765522#M894603</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Please refer to:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xbe4ac4c76f92d611abdb0090277a778c,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xbe4ac4c76f92d611abdb0090277a778c,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
      <pubDate>Wed, 17 Jul 2002 04:41:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-in-file/m-p/2765522#M894603</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-07-17T04:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: read in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-in-file/m-p/2765523#M894604</link>
      <description>see the man page for dd.  There are flags to specify the source file and the block size in 512-byte increments.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;mark</description>
      <pubDate>Wed, 17 Jul 2002 12:31:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-in-file/m-p/2765523#M894604</guid>
      <dc:creator>Mark Greene_1</dc:creator>
      <dc:date>2002-07-17T12:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: read in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-in-file/m-p/2765524#M894605</link>
      <description>Hi Bhoyet,&lt;BR /&gt;&lt;BR /&gt;you can use the dd- command:&lt;BR /&gt;&lt;BR /&gt;dd if=/path/to/file bs=1 count=30 &lt;BR /&gt;&lt;BR /&gt;brings 30 bytes to standard output.&lt;BR /&gt;&lt;BR /&gt;var=`dd if=/path/to/file bs=1 count=30`&lt;BR /&gt;&lt;BR /&gt;gives the first 30 bytes of your file as value to the variable "var"&lt;BR /&gt;&lt;BR /&gt;Allways stay on the bright side of life!&lt;BR /&gt;&lt;BR /&gt;Peter</description>
      <pubDate>Wed, 17 Jul 2002 12:48:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-in-file/m-p/2765524#M894605</guid>
      <dc:creator>Peter Kloetgen</dc:creator>
      <dc:date>2002-07-17T12:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: read in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-in-file/m-p/2765525#M894607</link>
      <description>Use could us "head" command with "-c" option.&lt;BR /&gt;&lt;BR /&gt;head -c -n 1000 filex &amp;gt;first1000bytes&lt;BR /&gt;&lt;BR /&gt;Would copy only the first 1000 bytes from filex.&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Wed, 17 Jul 2002 13:24:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-in-file/m-p/2765525#M894607</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-07-17T13:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: read in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-in-file/m-p/2765526#M894611</link>
      <description>Really Perl is the scripting language of choice for this. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;open F1, "&lt;MYFILE.DAT&gt;&lt;/MYFILE.DAT&gt;$n = read(F1,$s_in,8192);&lt;BR /&gt;# $n - number of bytes read&lt;BR /&gt;# $s_in contains the data up to 8192 bytes&lt;BR /&gt;&lt;BR /&gt;# now seek to offset 32768 and read again&lt;BR /&gt;seek(F1,32768,0);&lt;BR /&gt;$n = read(f1,$s_in,8192);&lt;BR /&gt;close F1;&lt;BR /&gt;&lt;BR /&gt;You would, of course, need to add some error checking but this is the clean scripting way to do this.&lt;BR /&gt;</description>
      <pubDate>Wed, 17 Jul 2002 13:26:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-in-file/m-p/2765526#M894611</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-07-17T13:26:38Z</dc:date>
    </item>
  </channel>
</rss>

