<?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: Testing for numbers in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/testing-for-numbers/m-p/3441825#M851285</link>
    <description>Hi,&lt;BR /&gt;var1=1&lt;BR /&gt;((var2=var/var1))&lt;BR /&gt;if [ $? -ne 0 ]&lt;BR /&gt;then&lt;BR /&gt;echo " It's a Alphanumeric Character"&lt;BR /&gt;else &lt;BR /&gt;echo "it's a numeric character "&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Hope that works.&lt;BR /&gt;Regards,&lt;BR /&gt;</description>
    <pubDate>Tue, 14 Dec 2004 04:26:58 GMT</pubDate>
    <dc:creator>Bharat Katkar</dc:creator>
    <dc:date>2004-12-14T04:26:58Z</dc:date>
    <item>
      <title>Testing for numbers</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/testing-for-numbers/m-p/3441820#M851280</link>
      <description>I have a lotid inside a file with the following patterns&lt;BR /&gt;....&lt;BR /&gt;....&lt;BR /&gt;DIFFLOTID, 1234&lt;BR /&gt;....&lt;BR /&gt;....&lt;BR /&gt;&lt;BR /&gt;where 1234 is the lotid.&lt;BR /&gt;I would like to ask, how can i test it if the lotid contains other character other than numbers.&lt;BR /&gt;Maximum points to all correct replies.</description>
      <pubDate>Mon, 13 Dec 2004 01:01:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/testing-for-numbers/m-p/3441820#M851280</guid>
      <dc:creator>Pando</dc:creator>
      <dc:date>2004-12-13T01:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: Testing for numbers</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/testing-for-numbers/m-p/3441821#M851281</link>
      <description>awk -F"," {if ($2 !~ /[[:alpha:]]/ )&lt;BR /&gt;print $0" OK lotid"&lt;BR /&gt;else&lt;BR /&gt;print $0" bad lotid"&lt;BR /&gt;' fileWithLotids</description>
      <pubDate>Mon, 13 Dec 2004 01:43:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/testing-for-numbers/m-p/3441821#M851281</guid>
      <dc:creator>Michael Roberts_3</dc:creator>
      <dc:date>2004-12-13T01:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Testing for numbers</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/testing-for-numbers/m-p/3441822#M851282</link>
      <description>Hi,&lt;BR /&gt;another possibility is to read the field and delete all numeric charecters from it to check if something still remains -  as in the attached script, which can be run like this:&lt;BR /&gt;# attached.sh &lt;YOUR_INFILE&gt;&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;/YOUR_INFILE&gt;</description>
      <pubDate>Tue, 14 Dec 2004 03:15:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/testing-for-numbers/m-p/3441822#M851282</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2004-12-14T03:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: Testing for numbers</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/testing-for-numbers/m-p/3441823#M851283</link>
      <description>Hi,&lt;BR /&gt;Another solution is to assign the value to a integer variable (typeset -i &lt;VAR_NAME&gt;. If the value is not an integer you get an error message and $? is set to 1.&lt;/VAR_NAME&gt;</description>
      <pubDate>Tue, 14 Dec 2004 03:42:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/testing-for-numbers/m-p/3441823#M851283</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2004-12-14T03:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Testing for numbers</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/testing-for-numbers/m-p/3441824#M851284</link>
      <description>Hello John and Michael,&lt;BR /&gt;&lt;BR /&gt;Thanks for the replies. My querries are, test 1234 as numeric or alphanumeric. The field DIFFLOTID either contains 1234 or 1234ver value. The reason i would like to test the value is because most value should contain numerics only but somehow i saw some value with alphanumerics e.g., 1234a, cor_1234 etc..&lt;BR /&gt;I currently get the value of DIFFLOTID using the command below: &lt;BR /&gt;&lt;BR /&gt;Var=$(awk -F "," '/DIFFLOTID/ {print $2}' $FILE)&lt;BR /&gt;&lt;BR /&gt;The $Var now contains the value and i need to test it if $Var is numeric or alphanumeric.&lt;BR /&gt;If the $Var is alphanumeric, i need to move it to a temporary directory.&lt;BR /&gt;&lt;BR /&gt;Many thanks for your help.</description>
      <pubDate>Tue, 14 Dec 2004 03:57:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/testing-for-numbers/m-p/3441824#M851284</guid>
      <dc:creator>Pando</dc:creator>
      <dc:date>2004-12-14T03:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: Testing for numbers</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/testing-for-numbers/m-p/3441825#M851285</link>
      <description>Hi,&lt;BR /&gt;var1=1&lt;BR /&gt;((var2=var/var1))&lt;BR /&gt;if [ $? -ne 0 ]&lt;BR /&gt;then&lt;BR /&gt;echo " It's a Alphanumeric Character"&lt;BR /&gt;else &lt;BR /&gt;echo "it's a numeric character "&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Hope that works.&lt;BR /&gt;Regards,&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Dec 2004 04:26:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/testing-for-numbers/m-p/3441825#M851285</guid>
      <dc:creator>Bharat Katkar</dc:creator>
      <dc:date>2004-12-14T04:26:58Z</dc:date>
    </item>
  </channel>
</rss>

