<?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 the last character(s) from a word in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-the-last-character-s-from-a-word/m-p/3693503#M247652</link>
    <description>Hi,&lt;BR /&gt;to obtain only teh difit:&lt;BR /&gt;echo "sclap1 scl_ap2 sclk_ap3 sclok_ap20"|tr -d [:alpha:][:punct:]&lt;BR /&gt;&lt;BR /&gt;It ill retrun aonly the difit in teh strings.&lt;BR /&gt;HTH,&lt;BR /&gt;Art</description>
    <pubDate>Mon, 19 Dec 2005 05:19:22 GMT</pubDate>
    <dc:creator>Arturo Galbiati</dc:creator>
    <dc:date>2005-12-19T05:19:22Z</dc:date>
    <item>
      <title>Cut the last character(s) from a word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-the-last-character-s-from-a-word/m-p/3693495#M247644</link>
      <description>Hi &lt;BR /&gt;&lt;BR /&gt;Anybody know how to cut last few character(s) &lt;BR /&gt;from a word. &lt;BR /&gt;&lt;BR /&gt;I have sclap1,scl_ap2,sclk_ap3...sclok_ap20. and want to cut 1,2...20. or atleast ap1,ap2,....ap20&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Sajeesh</description>
      <pubDate>Sat, 17 Dec 2005 11:08:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-the-last-character-s-from-a-word/m-p/3693495#M247644</guid>
      <dc:creator>Sajeesh O.K</dc:creator>
      <dc:date>2005-12-17T11:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Cut the last character(s) from a word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-the-last-character-s-from-a-word/m-p/3693496#M247645</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you can use tr utility:&lt;BR /&gt;ex:&lt;BR /&gt;echo sclk_ap3 | tr -d [:digit:]</description>
      <pubDate>Sat, 17 Dec 2005 11:18:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-the-last-character-s-from-a-word/m-p/3693496#M247645</guid>
      <dc:creator>Slawomir Gora</dc:creator>
      <dc:date>2005-12-17T11:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Cut the last character(s) from a word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-the-last-character-s-from-a-word/m-p/3693497#M247646</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You can use awk:&lt;BR /&gt;awk '{printt substr($0,1,length($0)-N)}' N=3 file&lt;BR /&gt;&lt;BR /&gt;You can chnge N as you need &lt;BR /&gt;HTH</description>
      <pubDate>Sat, 17 Dec 2005 11:59:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-the-last-character-s-from-a-word/m-p/3693497#M247646</guid>
      <dc:creator>Victor Fridyev</dc:creator>
      <dc:date>2005-12-17T11:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: Cut the last character(s) from a word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-the-last-character-s-from-a-word/m-p/3693498#M247647</link>
      <description>Hi Sajeesh:&lt;BR /&gt;&lt;BR /&gt;# echo sclok_ap20|sed 's/[0-9]\{1,\}//g' &lt;BR /&gt;&lt;BR /&gt;This will remove any number of digits.  If you want to specify a range of digits, as for example only 2-3 digits, but not one or more than four:&lt;BR /&gt;&lt;BR /&gt;# sclok_ap20|sed 's/[0-9]\{2,3\}//g' &lt;BR /&gt;&lt;BR /&gt;In general, {m,n} specifies the minimum number and the maximum number.  If 'n' is omitted, as in the first example, then the maximum is unlimited.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sat, 17 Dec 2005 12:17:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-the-last-character-s-from-a-word/m-p/3693498#M247647</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-12-17T12:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: Cut the last character(s) from a word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-the-last-character-s-from-a-word/m-p/3693499#M247648</link>
      <description>Hi All&lt;BR /&gt;&lt;BR /&gt;Actually I want to capture the digit from these words, not to exclude. It will be either 1 digit or 2 digit.&lt;BR /&gt;&lt;BR /&gt;I have to use these captured number within a for loop&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Sajeesh&lt;BR /&gt;</description>
      <pubDate>Sat, 17 Dec 2005 12:28:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-the-last-character-s-from-a-word/m-p/3693499#M247648</guid>
      <dc:creator>Sajeesh O.K</dc:creator>
      <dc:date>2005-12-17T12:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: Cut the last character(s) from a word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-the-last-character-s-from-a-word/m-p/3693500#M247649</link>
      <description>Hi (again) Sajeesh:&lt;BR /&gt;&lt;BR /&gt;OK, then let's use perl:&lt;BR /&gt;&lt;BR /&gt;# echo sclok_ap20|perl -nle 'm/(\d+)/;print $1'&lt;BR /&gt;&lt;BR /&gt;...prints 20&lt;BR /&gt;&lt;BR /&gt;This extracts one or more digits.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sat, 17 Dec 2005 12:48:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-the-last-character-s-from-a-word/m-p/3693500#M247649</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-12-17T12:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Cut the last character(s) from a word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-the-last-character-s-from-a-word/m-p/3693501#M247650</link>
      <description>Hi,&lt;BR /&gt;simple script to get digits&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;NAMES="sclap1 scl_ap2 sclk_ap3 sclok_ap20"&lt;BR /&gt;&lt;BR /&gt;for N  in `echo $NAMES`&lt;BR /&gt;do&lt;BR /&gt;   NR=`echo ${N} | tr -d [:alpha:] | tr -d '_'`&lt;BR /&gt;   echo ${NR}&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Sat, 17 Dec 2005 13:08:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-the-last-character-s-from-a-word/m-p/3693501#M247650</guid>
      <dc:creator>Slawomir Gora</dc:creator>
      <dc:date>2005-12-17T13:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: Cut the last character(s) from a word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-the-last-character-s-from-a-word/m-p/3693502#M247651</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Thanks to you all. Not familer with the perl, so used the last one.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Sajeesh&lt;BR /&gt;</description>
      <pubDate>Sat, 17 Dec 2005 22:57:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-the-last-character-s-from-a-word/m-p/3693502#M247651</guid>
      <dc:creator>Sajeesh O.K</dc:creator>
      <dc:date>2005-12-17T22:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Cut the last character(s) from a word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-the-last-character-s-from-a-word/m-p/3693503#M247652</link>
      <description>Hi,&lt;BR /&gt;to obtain only teh difit:&lt;BR /&gt;echo "sclap1 scl_ap2 sclk_ap3 sclok_ap20"|tr -d [:alpha:][:punct:]&lt;BR /&gt;&lt;BR /&gt;It ill retrun aonly the difit in teh strings.&lt;BR /&gt;HTH,&lt;BR /&gt;Art</description>
      <pubDate>Mon, 19 Dec 2005 05:19:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-the-last-character-s-from-a-word/m-p/3693503#M247652</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2005-12-19T05:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Cut the last character(s) from a word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-the-last-character-s-from-a-word/m-p/3693504#M247653</link>
      <description>Same thread in linux too :). See the replies there.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=984492" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=984492&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Do you want to get digits only then,&lt;BR /&gt;&lt;BR /&gt;simpy then,&lt;BR /&gt;&lt;BR /&gt;# cat file&lt;BR /&gt;sclap1&lt;BR /&gt;scl_ap2&lt;BR /&gt;sclk_ap3&lt;BR /&gt;sclok_ap20&lt;BR /&gt;# sed 's/^[^0-9]*//' file&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;20&lt;BR /&gt;&lt;BR /&gt;# for i in `sed 's/^[^0-9]*//' file`&lt;BR /&gt;&amp;gt; do&lt;BR /&gt;&amp;gt;   echo $i&lt;BR /&gt;&amp;gt; done&lt;BR /&gt;&lt;BR /&gt;-Muthu&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Dec 2005 05:23:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-the-last-character-s-from-a-word/m-p/3693504#M247653</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-12-19T05:23:31Z</dc:date>
    </item>
  </channel>
</rss>

