<?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: cut specific characters in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-specific-characters/m-p/4791495#M391817</link>
    <description>&amp;gt;Jean-Philippe: awk 'NR == 2 { print substr($0, 2, 3) }' test.txt&lt;BR /&gt;&lt;BR /&gt;You may want to optimize this by adding "exit" so you don't read all zillion lines of the file:&lt;BR /&gt;awk 'NR == 2 { print substr($0, 2, 3); exit }' test.txt&lt;BR /&gt;</description>
    <pubDate>Sat, 28 May 2011 08:36:55 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2011-05-28T08:36:55Z</dc:date>
    <item>
      <title>cut specific characters</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-specific-characters/m-p/4791491#M391813</link>
      <description>I would like to use a script to cut a string from a file ( test.txt ) , cut the string on line 2 , from the second character , cut 3 characters from it , the result should as "ran" , can advise how to do it ? Thanks &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$vi test.txt &lt;BR /&gt;apple&lt;BR /&gt;orange&lt;BR /&gt;pine&lt;BR /&gt;banana&lt;BR /&gt;</description>
      <pubDate>Tue, 24 May 2011 10:08:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-specific-characters/m-p/4791491#M391813</guid>
      <dc:creator>ivywong1</dc:creator>
      <dc:date>2011-05-24T10:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: cut specific characters</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-specific-characters/m-p/4791492#M391814</link>
      <description>put this in a script&lt;BR /&gt;=====================&lt;BR /&gt;cat test.txt |head -2 |tail -1 |cut -c 2-4&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;you need to save it in a variable.&lt;BR /&gt;var=`cat /test |head -2 |tail -1 |cut -c 2-4`</description>
      <pubDate>Tue, 24 May 2011 10:24:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-specific-characters/m-p/4791492#M391814</guid>
      <dc:creator>kemo</dc:creator>
      <dc:date>2011-05-24T10:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: cut specific characters</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-specific-characters/m-p/4791493#M391815</link>
      <description>or &lt;BR /&gt;&lt;BR /&gt;sed -ne "2,2p" test.txt|cut -c 2,4&lt;BR /&gt;&lt;BR /&gt;if you want to assign it to variable to use it later&lt;BR /&gt;&lt;BR /&gt;MYVARIABLE=$(sed -ne "2,2p" test.txt|cut -c 2,4)&lt;BR /&gt;&lt;BR /&gt;$() construct is the newer and more appropriate form of the command quoted in backticks. FO the time being, both work the same way.</description>
      <pubDate>Tue, 24 May 2011 13:45:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-specific-characters/m-p/4791493#M391815</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2011-05-24T13:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: cut specific characters</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-specific-characters/m-p/4791494#M391816</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;awk 'NR == 2 { print substr ( $0, 2, 3 ) }' test.txt&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;&lt;BR /&gt;Jean-Philippe</description>
      <pubDate>Wed, 25 May 2011 10:10:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-specific-characters/m-p/4791494#M391816</guid>
      <dc:creator>Jean-Philippe Henry</dc:creator>
      <dc:date>2011-05-25T10:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: cut specific characters</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-specific-characters/m-p/4791495#M391817</link>
      <description>&amp;gt;Jean-Philippe: awk 'NR == 2 { print substr($0, 2, 3) }' test.txt&lt;BR /&gt;&lt;BR /&gt;You may want to optimize this by adding "exit" so you don't read all zillion lines of the file:&lt;BR /&gt;awk 'NR == 2 { print substr($0, 2, 3); exit }' test.txt&lt;BR /&gt;</description>
      <pubDate>Sat, 28 May 2011 08:36:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-specific-characters/m-p/4791495#M391817</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-05-28T08:36:55Z</dc:date>
    </item>
  </channel>
</rss>

