<?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: help needed scripting urgent plzz in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872151#M96517</link>
    <description>&lt;!--!*#--&gt;&amp;gt;numerics are not enclosed in ""&lt;BR /&gt;&lt;BR /&gt;If this pattern in your data is consistent then simply test if 3,7 and 10 start with ".&lt;BR /&gt;&lt;BR /&gt;What is still confusing is whether this test is logically ANDed to the test of field length?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;i want to check whether all the fields are of specific lenght which is predefined &amp;gt;(i have kept it in an array len='2 2 2 2 2 2 2 2 4 5' ) and also check whether &amp;gt;numeric fields (3,7,10)are numeric or not.&lt;BR /&gt;&amp;gt;line number should be returned in both cases&lt;BR /&gt;&lt;BR /&gt;Does this mean that you want to check if each of the fields is of the specified length AND if 3,7,10 are numeric? If this ANDed test is true then return line number otherwise not??? IMHO...what happens if fields are of specified length but 3,7,10 are not-numeric or vice-versa??? please clarify this.&lt;BR /&gt;&lt;BR /&gt;The script below removes embedded commas from non-numeric fields and prints the line numbers if 3,7,10 are numeric or not. Invoke as:&lt;BR /&gt;&lt;BR /&gt;# myawkscr input_file&lt;BR /&gt;&lt;BR /&gt;==========================================================&lt;BR /&gt;#!/usr/bin/sh -x&lt;BR /&gt;&lt;BR /&gt;awk -F, '{&lt;BR /&gt;   for (i=1;i&amp;lt;=NF;++i) {&lt;BR /&gt;      if ($i~/^"[A-Za-z]+$/)&lt;BR /&gt;         printf("%s ",$i)&lt;BR /&gt;      else if ($i~/^[A-Za-z]+$/)&lt;BR /&gt;         printf("%s ",$i)&lt;BR /&gt;      else if ($i~/^[A-Za-z]+"$/)&lt;BR /&gt;         printf((i&lt;NF&gt;&lt;/NF&gt;      else&lt;BR /&gt;         printf((i&lt;NF&gt;&lt;/NF&gt;   }&lt;BR /&gt;}' $1 | awk -F, '{&lt;BR /&gt;   if ($3 !~ /^"/ &amp;amp;&amp;amp; $7 !~ /^"/ &amp;amp;&amp;amp; $10 !~ /^"/)&lt;BR /&gt;      printf("line %d [$3 $7 $10 all-numeric]  %s\n",NR,$0)&lt;BR /&gt;   else&lt;BR /&gt;      printf("line %d [$3 $7 $10 non-numeric]  %s\n",NR,$0)&lt;BR /&gt;}'&lt;BR /&gt;</description>
    <pubDate>Thu, 05 Oct 2006 13:26:18 GMT</pubDate>
    <dc:creator>Sandman!</dc:creator>
    <dc:date>2006-10-05T13:26:18Z</dc:date>
    <item>
      <title>help needed scripting urgent plzz</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872129#M96495</link>
      <description>hi all,&lt;BR /&gt; &lt;BR /&gt;   I am having a file with the following format.&lt;BR /&gt;"ABC",1809593008,"MYHOME",20061002,"SITON,theback",abcdef,...&lt;BR /&gt;There will be so many records in the file and 17 fields in every record. i hav 3 requirements.&lt;BR /&gt;1.I want to remove commas(,) if any encountered ONLY in " " in all records.&lt;BR /&gt;&lt;BR /&gt;2.Each field is of specified field length (predefined which im having but i cant use it in a file, i need to hard code them in script). I want to check whether each field is of its predefined length or not.&lt;BR /&gt;3. If 15th field is present, then 14th 11th field should also be present. If not it should return the record number.&lt;BR /&gt;&lt;BR /&gt;i need a function a function for the last 2</description>
      <pubDate>Fri, 29 Sep 2006 06:58:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872129#M96495</guid>
      <dc:creator>viseshu</dc:creator>
      <dc:date>2006-09-29T06:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: help needed scripting urgent plzz</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872130#M96496</link>
      <description>plz note : i want to replace the comma mentioned above with a space</description>
      <pubDate>Fri, 29 Sep 2006 06:59:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872130#M96496</guid>
      <dc:creator>viseshu</dc:creator>
      <dc:date>2006-09-29T06:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: help needed scripting urgent plzz</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872131#M96497</link>
      <description>Hey;&lt;BR /&gt;&lt;BR /&gt;Can you provide a short test file for us to work against?  Maybe 100 lines or so?&lt;BR /&gt;&lt;BR /&gt;Doug</description>
      <pubDate>Fri, 29 Sep 2006 08:16:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872131#M96497</guid>
      <dc:creator>Doug O'Leary</dc:creator>
      <dc:date>2006-09-29T08:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: help needed scripting urgent plzz</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872132#M96498</link>
      <description>Iam atttaching a short file containing 8 fields in each record. As i dont hav any sample file of the same specification im attaching this. Please help</description>
      <pubDate>Fri, 29 Sep 2006 08:39:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872132#M96498</guid>
      <dc:creator>viseshu</dc:creator>
      <dc:date>2006-09-29T08:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: help needed scripting urgent plzz</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872133#M96499</link>
      <description>Hmm, that's a bit lame not to have decend sample data. How will you verify your work?&lt;BR /&gt;&lt;BR /&gt;Anyway, here is something to get you going.&lt;BR /&gt;It does not deal with the length requirements, but if you read and understand the split on double-quote, then you can do something like that spliting the line by commas and walkign the fields.&lt;BR /&gt;&lt;BR /&gt;#cat test.pl&lt;BR /&gt;my (@quoted) = split /"/;&lt;BR /&gt;my ($i)=1;&lt;BR /&gt;while ($i &amp;lt; @quoted) {&lt;BR /&gt;  $quoted[$i] =~ s/,/ /g;&lt;BR /&gt;  $i += 2;&lt;BR /&gt;}&lt;BR /&gt;$_ = join "\"", @quoted ;&lt;BR /&gt;my ($one,$two,$three,$four,$five) = split /,/;&lt;BR /&gt;if ($four ne "" and $two eq "") {&lt;BR /&gt;   print STDERR "Missing field X at line $.\n";&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;#cat x.txt&lt;BR /&gt;"ABC",1809593008,"MYHOME",20061002,"SITON,theback"&lt;BR /&gt;"DEF",1809593008,"MY,HOME",20061002,"SITON,theback"&lt;BR /&gt;"GHI",,"MYHOME",,"SITON,theback"&lt;BR /&gt;"JKL",,"MYHOME",20061002,"SITON,theback"&lt;BR /&gt;"MNO",1809593008,"MYHOME",20061002,"SITON,theback"&lt;BR /&gt;&lt;BR /&gt;# perl -p test.pl x.tmp &amp;gt; y.txt&lt;BR /&gt;Missing field X at line 4&lt;BR /&gt;&lt;BR /&gt;#cat y.txt&lt;BR /&gt;"ABC",1809593008,"MYHOME",20061002,"SITON theback"&lt;BR /&gt;"DEF",1809593008,"MY HOME",20061002,"SITON theback"&lt;BR /&gt;"GHI",,"MYHOME",,"SITON theback"&lt;BR /&gt;"JKL",,"MYHOME",20061002,"SITON theback"&lt;BR /&gt;"MNO",1809593008,"MYHOME",20061002,"SITON theback"&lt;BR /&gt;&lt;BR /&gt;Good luck!&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Sep 2006 09:20:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872133#M96499</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-09-29T09:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: help needed scripting urgent plzz</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872134#M96500</link>
      <description>Hein, sorry im not doing it in perl..</description>
      <pubDate>Fri, 29 Sep 2006 09:30:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872134#M96500</guid>
      <dc:creator>viseshu</dc:creator>
      <dc:date>2006-09-29T09:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: help needed scripting urgent plzz</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872135#M96501</link>
      <description>&lt;!--!*#--&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I asked myself, if I should send an answer to a thread, containing the message&lt;BR /&gt;&amp;gt;&amp;gt;&lt;BR /&gt;I'm not doing it in perl&lt;BR /&gt;&amp;lt;&amp;lt;&lt;BR /&gt;Why?&lt;BR /&gt;Is it allowed to use awk?&lt;BR /&gt;&lt;BR /&gt;But nevertheless ...:&lt;BR /&gt;1.) I asume it is NOT allowed for a field to contain a single quote " only.&lt;BR /&gt;I use the quote as delimiter and substitue even field numbers only.&lt;BR /&gt;cat /tmp/a&lt;BR /&gt;"ABC",1809593008,"MYHOME",20061002,"SITON,the,back",abcdef,..,""&lt;BR /&gt;&lt;BR /&gt;awk -F'"' '{printf $1;for(i=2;i&amp;lt;=NF;i++) {if(! (i%2)) gsub(","," ",$i);printf FS""$i}; printf"\n"}' /tmp/a&lt;BR /&gt;"ABC",1809593008,"MYHOME",20061002,"SITON the back",abcdef,..,""&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;2.) I assume your field delimiter is comma, and your data is clean in respect to this delimiter after 1.)&lt;BR /&gt;&lt;BR /&gt;Set a variable containing the length data in the format&lt;BR /&gt;len='l1 l2 l3 .. ln'&lt;BR /&gt;That way you have built an array where&lt;BR /&gt;l[i] contains the length of the i-th field.&lt;BR /&gt;=&amp;gt; No hardcoding needed!&lt;BR /&gt;&lt;BR /&gt;awk -F, -v len="$len" 'BEGIN {f=split(len,l," ")}&lt;BR /&gt;{for(i=1;i&amp;lt;=NF;i++) if(length($i)!=l[i]) printf("size mismatch in line %d, field %d\n",NR,i)}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;3.) self explanatory - add to 2.)&lt;BR /&gt;{if($15 &amp;amp;&amp;amp; !($14 || $11)) print NR}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;It should be easy to combine the tasks together.&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Fri, 29 Sep 2006 13:24:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872135#M96501</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-09-29T13:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: help needed scripting urgent plzz</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872136#M96502</link>
      <description>&lt;!--!*#--&gt;If you're okay with awk then try the script below. It removes embedded commas from fields that are alphabetic strings and are enclosed in double-quotes:&lt;BR /&gt;&lt;BR /&gt;awk -F, '{&lt;BR /&gt;   for (i=1;i&amp;lt;=NF;++i) {&lt;BR /&gt;      if ($i~/^"[A-Za-z]+$/)&lt;BR /&gt;         printf("%s ",$i)&lt;BR /&gt;      else if ($i~/^[A-Za-z]+$/)&lt;BR /&gt;         printf("%s ",$i)&lt;BR /&gt;      else if ($i~/^[A-Za-z]+"$/)&lt;BR /&gt;         printf((i&lt;NF&gt;&lt;/NF&gt;      else&lt;BR /&gt;         printf((i&lt;NF&gt;&lt;/NF&gt;   }&lt;BR /&gt;}' infile&lt;BR /&gt;&lt;BR /&gt;~hope it helps</description>
      <pubDate>Fri, 29 Sep 2006 16:26:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872136#M96502</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-09-29T16:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: help needed scripting urgent plzz</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872137#M96503</link>
      <description>Peter,&lt;BR /&gt;    thanks a lot &lt;BR /&gt;1)replacing , with space is working fine but can u please xplain the concept of that even field, i did not get tht..{if(! (i%2)) what is this doing...im not gettting...plzzz explain clearly......:(</description>
      <pubDate>Sat, 30 Sep 2006 04:53:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872137#M96503</guid>
      <dc:creator>viseshu</dc:creator>
      <dc:date>2006-09-30T04:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: help needed scripting urgent plzz</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872138#M96504</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;look at this example string:&lt;BR /&gt;"ABC",1809593008,"MYHOME",20061002,"SITON,the,back",abcdef,..,""&lt;BR /&gt;&lt;BR /&gt;If you take the quote (") as delimiter, these are your records - I call then f1:&lt;BR /&gt;1  &lt;EMPTY&gt;&lt;BR /&gt;2  ABC&lt;BR /&gt;3  ,1809593008,&lt;BR /&gt;4  MYHOME&lt;BR /&gt;5  ,20061002,&lt;BR /&gt;6  SITON,the,back&lt;BR /&gt;7  abcdef&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;If you take your original delimiter, I call the records f2.&lt;BR /&gt;&lt;BR /&gt;You see, that records in f1 which contain commata are only of interest, when the record number is even.&lt;BR /&gt;Odd record numbers of f1 containing commata consist of records of f2 containing NO COMMATA only.&lt;BR /&gt;So you must note, how important my assumption to solution 1 is, that there mustn't be fields of f2 containing a single quote only:&lt;BR /&gt;If that where the case you couldn't decide by algorithm, how records of f1 and f2 interact together.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So you must transform in even record numbers - exactly only in the even ones - your comma to space.&lt;BR /&gt;&lt;BR /&gt;The % operator is the modulo function, so&lt;BR /&gt;(i%2) is zero for even and one for odd i, leading to the expression&lt;BR /&gt;(! (i%2)) which evaluates to true for even numbers.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;IMHO some looking at the man page of awk could help...&lt;BR /&gt;&lt;BR /&gt;mfG Peter&lt;BR /&gt;&lt;BR /&gt;PS: I really think I have earned some points now :-)&lt;BR /&gt;&lt;/EMPTY&gt;</description>
      <pubDate>Sun, 01 Oct 2006 05:13:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872138#M96504</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-10-01T05:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: help needed scripting urgent plzz</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872139#M96505</link>
      <description>Thank u very much peter.....very helpful ur explanation....and 1 more thing is like,for 3) along with the current requirement i want to check whether 3,7,10 filds are numeric or not ..u have provided me&lt;BR /&gt;&lt;BR /&gt;awk -F, -v len="$len" 'BEGIN {f=split(len,l," ")}&lt;BR /&gt;{for(i=1;i&amp;lt;=NF;i++) if(length($i)!=l[i]) printf("size mismatch in line %d, field %d\n",NR,i)}&lt;BR /&gt;&lt;BR /&gt;i want to check whether 3,7,10 fields are numberic or not if not numberic i want to return the record number.</description>
      <pubDate>Tue, 03 Oct 2006 05:02:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872139#M96505</guid>
      <dc:creator>viseshu</dc:creator>
      <dc:date>2006-10-03T05:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: help needed scripting urgent plzz</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872140#M96506</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;to check for numeric data in record i only, use something like that:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;if(match($i,"[^0-9]")) printf("record %d line %d contains non-numeric data\n",i,NR)&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;To integrate this check I suggest:&lt;BR /&gt;- set an addtional variable containing the record numbers to check for numerical input&lt;BR /&gt;nc='3 7 10'&lt;BR /&gt;- feed it to awk the same way as "$len"&lt;BR /&gt;- loop over this additional array in every cycle of the loop over all records.&lt;BR /&gt;If your field numbers are static, you can do it static in your program as well. Though I do not recommend this generally (things may change and solutions migrate...), this will be faster:&lt;BR /&gt;&lt;BR /&gt;awk -F, -v len="$len" 'BEGIN {f=split(len,l," ")}&lt;BR /&gt;{for(i=1;i&amp;lt;=NF;i++) {&lt;BR /&gt;if(length($i)!=l[i]) printf("size mismatch in line %d, field %d\n",NR,i)&lt;BR /&gt;if ((i==3)||(i==7)||(i==19)) if(match($i,"[^0-9]")) printf("line %d field %d contains non-numeric data,%s,\n",NR,i,$i)&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Tue, 03 Oct 2006 07:51:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872140#M96506</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-10-03T07:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: help needed scripting urgent plzz</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872141#M96507</link>
      <description>&amp;gt;&amp;gt; Hein, sorry im not doing it in perl..&lt;BR /&gt;&lt;BR /&gt;Yes indeed. &lt;BR /&gt;&lt;BR /&gt;You will be sorry you are not doing it in perl &lt;BR /&gt;&lt;BR /&gt;:-).&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Oct 2006 09:15:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872141#M96507</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-10-03T09:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: help needed scripting urgent plzz</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872142#M96508</link>
      <description>Peter,&lt;BR /&gt;         i want to check whether a variable is numeric(it contains some number) or not how can i do that ????</description>
      <pubDate>Wed, 04 Oct 2006 23:09:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872142#M96508</guid>
      <dc:creator>viseshu</dc:creator>
      <dc:date>2006-10-04T23:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: help needed scripting urgent plzz</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872143#M96509</link>
      <description>Peter,&lt;BR /&gt;      ur script&lt;BR /&gt;awk -F, -v len="$len" 'BEGIN {f=split(len,l," ")}&lt;BR /&gt;{for(i=1;i&amp;lt;=NF;i++) {&lt;BR /&gt;if(length($i)!=l[i]) printf("size mismatch in line %d, field %d\n",NR,i)&lt;BR /&gt;if ((i==3)||(i==7)||(i==10)) if(match($i,"[^0-9]")) printf("line %d field %d con&lt;BR /&gt;tains non-numeric data,%s,\n",NR,i,$i)&lt;BR /&gt;}&lt;BR /&gt;}' &lt;BR /&gt;is working very fine with data like&lt;BR /&gt;hi,bye,12,ui,ki,lo,344,bo,mlbo,sony&lt;BR /&gt;with length array as &lt;BR /&gt;len='2 2 2 2 2 2 2 2 4 5'&lt;BR /&gt;But concern is&lt;BR /&gt;MY DATA CONTAINS "" data like&lt;BR /&gt;"hi","bh","12","ih","j","mk","12","hi","sony","12345"&lt;BR /&gt;all data will be in "" seperated by comma.Please provide me solution for this scenario..its urgent plzzzzzzzzzz</description>
      <pubDate>Thu, 05 Oct 2006 00:05:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872143#M96509</guid>
      <dc:creator>viseshu</dc:creator>
      <dc:date>2006-10-05T00:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: help needed scripting urgent plzz</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872144#M96510</link>
      <description>Did you try my awk script...does it not meet your requirements?</description>
      <pubDate>Thu, 05 Oct 2006 01:07:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872144#M96510</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-10-05T01:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: help needed scripting urgent plzz</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872145#M96511</link>
      <description>sandy, &lt;BR /&gt;   its working fine...thanku very much..il assign the points as soon as im done with my work. &lt;BR /&gt;how can u check whether a variable is numeric ornot??&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Oct 2006 01:54:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872145#M96511</guid>
      <dc:creator>viseshu</dc:creator>
      <dc:date>2006-10-05T01:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: help needed scripting urgent plzz</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872146#M96512</link>
      <description>&amp;gt;how can u check whether a variable is numeric ornot??&lt;BR /&gt;&lt;BR /&gt;Do you mean within the awk script or outside of it? Could you give a more concrete example of what you're trying to do?&lt;BR /&gt;&lt;BR /&gt;thanks!</description>
      <pubDate>Thu, 05 Oct 2006 02:07:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872146#M96512</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-10-05T02:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: help needed scripting urgent plzz</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872147#M96513</link>
      <description>not in awk sandy, just like as we check whether a string is not null or not&lt;BR /&gt;Ex: if [[ -n $VAR ]] in this way??? if there is no option then im ready to go with awk even.&lt;BR /&gt;i have file with many records like&lt;BR /&gt;"hi","bh",12,"ih","j","mk",12,"hi","sony",12345&lt;BR /&gt;i want to check whether all the fields are of specific lenght which is predefined(i have kept it in an array len='2 2 2 2 2 2 2 2 4 5' ) and also check whether numeric fields (3,7,10)are numeric or not.&lt;BR /&gt;line number should be returned in both cases</description>
      <pubDate>Thu, 05 Oct 2006 03:57:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872147#M96513</guid>
      <dc:creator>viseshu</dc:creator>
      <dc:date>2006-10-05T03:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: help needed scripting urgent plzz</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872148#M96514</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I'm not shure what you want now:&lt;BR /&gt;If your data is like you have discribed in your first questions, this 'check-for-numeric' should be done in awk.&lt;BR /&gt;Neverthess, data like&lt;BR /&gt;"123"&lt;BR /&gt;are non-numeric (normally) IMHO.&lt;BR /&gt;&lt;BR /&gt;You have the choice of making an implicit assumption, that your records you want to check contain always data of format "&lt;NUMBER&gt;" or checking that explicitly.&lt;BR /&gt;I would do the second.&lt;BR /&gt;&lt;BR /&gt;So modify your awk&lt;BR /&gt;1) to set a variable containing the quote " to get the possibility to handle this character in the inner of the awk program&lt;BR /&gt;&lt;BR /&gt;awk -v qu='"' ...&lt;BR /&gt;&lt;BR /&gt;2) add additional checks for quoted numeric values like&lt;BR /&gt;...original...&lt;BR /&gt;if(match($i,"[^0-9]")) printf("record %d line %d contains non-numeric data\n",i,NR)&lt;BR /&gt;... to ...&lt;BR /&gt;&lt;BR /&gt;if(match($i,qu) {split($i,tt,qu); rec=tt[2]}&lt;BR /&gt;else rec=$i&lt;BR /&gt;if(match(rec,"[^0-9]")) printf("record %d line %d contains non-numeric data\n",rec,NR)&lt;BR /&gt;&lt;BR /&gt;mfG Peter&lt;BR /&gt;mfG Peter&lt;/NUMBER&gt;</description>
      <pubDate>Thu, 05 Oct 2006 07:15:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-scripting-urgent-plzz/m-p/3872148#M96514</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-10-05T07:15:41Z</dc:date>
    </item>
  </channel>
</rss>

