<?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: test for test field qualifier in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/test-for-test-field-qualifier/m-p/3459099#M848533</link>
    <description>If the final field before the .res is always numeric, you might try&lt;BR /&gt;&lt;BR /&gt;ll *_????_[0-9]*.res&lt;BR /&gt;&lt;BR /&gt;Substituting 9144 for ???? as required?&lt;BR /&gt;</description>
    <pubDate>Mon, 10 Jan 2005 06:15:21 GMT</pubDate>
    <dc:creator>Stephen Keane</dc:creator>
    <dc:date>2005-01-10T06:15:21Z</dc:date>
    <item>
      <title>test for test field qualifier</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-for-test-field-qualifier/m-p/3459095#M848529</link>
      <description>I have 2 file below with the filename:&lt;BR /&gt;&lt;BR /&gt;(1) BLF1820E-90_SemAuto_97211_9144_0310743.res&lt;BR /&gt;(2) BLF177C_95442_9279_0510859.res&lt;BR /&gt;&lt;BR /&gt;As you can see, both fields are separated by underscore "_".&lt;BR /&gt;&lt;BR /&gt;When i tried the command:&lt;BR /&gt;&lt;BR /&gt;ll *_*_????_*.res&lt;BR /&gt;&lt;BR /&gt;it displays the 2 files. However, when i used the command:&lt;BR /&gt;&lt;BR /&gt;ll *_*_*_????_*.res&lt;BR /&gt;&lt;BR /&gt;it displays only 1 file.&lt;BR /&gt;&lt;BR /&gt;What i want to do is capture the 2nd last field  (9144 and 9279) for both files and use it as qualifier for listing the all the files.&lt;BR /&gt;&lt;BR /&gt;Maximum points for all correct answers.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 10 Jan 2005 02:39:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-for-test-field-qualifier/m-p/3459095#M848529</guid>
      <dc:creator>Pando</dc:creator>
      <dc:date>2005-01-10T02:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: test for test field qualifier</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-for-test-field-qualifier/m-p/3459096#M848530</link>
      <description>Hi Fernando,&lt;BR /&gt;&lt;BR /&gt;Are all the file names of the same length.&lt;BR /&gt;&lt;BR /&gt;TO capture the 2nd last field 9279&lt;BR /&gt;ls -l *_*_????_*.res | awk '{print $9}'| cut -c15-18&lt;BR /&gt;&lt;BR /&gt;But if the filenames are of different lengths then you will have to read them from reverse order and print the digits.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 10 Jan 2005 03:47:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-for-test-field-qualifier/m-p/3459096#M848530</guid>
      <dc:creator>Indira Aramandla</dc:creator>
      <dc:date>2005-01-10T03:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: test for test field qualifier</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-for-test-field-qualifier/m-p/3459097#M848531</link>
      <description>Hi Indira,&lt;BR /&gt;&lt;BR /&gt;The file is of different length.&lt;BR /&gt;&lt;BR /&gt;Can i ask how to read them from reverse order and print the digits as you suggested?&lt;BR /&gt;&lt;BR /&gt;Am very new to this. Many thanks.</description>
      <pubDate>Mon, 10 Jan 2005 04:18:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-for-test-field-qualifier/m-p/3459097#M848531</guid>
      <dc:creator>Pando</dc:creator>
      <dc:date>2005-01-10T04:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: test for test field qualifier</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-for-test-field-qualifier/m-p/3459098#M848532</link>
      <description>Well.. I'm on couple of drinks here, so stay with&lt;BR /&gt;me on this :-)&lt;BR /&gt;&lt;BR /&gt;If you are willing to use a script that takes an&lt;BR /&gt;argument and prints all the file names that has&lt;BR /&gt;the 2nd last parameter matching the argument,&lt;BR /&gt;then here is your solution.&lt;BR /&gt;&lt;BR /&gt;Create a file named "myls" with following contect:&lt;BR /&gt;----&lt;BR /&gt;for file in `ls *.res`&lt;BR /&gt;do&lt;BR /&gt;str=`echo $file | sed 's/_[0-9]*.res$/ /g' | sed 's/_/ /g'`&lt;BR /&gt;echo $str | grep -q "$1$"&lt;BR /&gt;if [ $? -eq 0 ]&lt;BR /&gt;then&lt;BR /&gt;    echo $file&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;------&lt;BR /&gt;&lt;BR /&gt;To print all files with 2nd last parameter as 9144,&lt;BR /&gt;use:&lt;BR /&gt;   # myls 9144&lt;BR /&gt;&lt;BR /&gt;Hope this helps..&lt;BR /&gt;- Biswajit&lt;BR /&gt;</description>
      <pubDate>Mon, 10 Jan 2005 04:42:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-for-test-field-qualifier/m-p/3459098#M848532</guid>
      <dc:creator>Biswajit Tripathy</dc:creator>
      <dc:date>2005-01-10T04:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: test for test field qualifier</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-for-test-field-qualifier/m-p/3459099#M848533</link>
      <description>If the final field before the .res is always numeric, you might try&lt;BR /&gt;&lt;BR /&gt;ll *_????_[0-9]*.res&lt;BR /&gt;&lt;BR /&gt;Substituting 9144 for ???? as required?&lt;BR /&gt;</description>
      <pubDate>Mon, 10 Jan 2005 06:15:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-for-test-field-qualifier/m-p/3459099#M848533</guid>
      <dc:creator>Stephen Keane</dc:creator>
      <dc:date>2005-01-10T06:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: test for test field qualifier</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-for-test-field-qualifier/m-p/3459100#M848534</link>
      <description>If you set up a loop for processing&lt;BR /&gt; &lt;BR /&gt;for x in *.res ; do&lt;BR /&gt;y=${x#*_}&lt;BR /&gt;echo ${y%_*}&lt;BR /&gt;done&lt;BR /&gt; &lt;BR /&gt;This will display the 2nd last field of each filename&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills&lt;BR /&gt;</description>
      <pubDate>Mon, 10 Jan 2005 10:29:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-for-test-field-qualifier/m-p/3459100#M848534</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-01-10T10:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: test for test field qualifier</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-for-test-field-qualifier/m-p/3459101#M848535</link>
      <description>Stephen wrote:&lt;BR /&gt;&amp;gt; If the final field before the .res is always numeric, &lt;BR /&gt;&amp;gt; you might try&lt;BR /&gt;&amp;gt; &lt;BR /&gt;&amp;gt; ll *_????_[0-9]*.res&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; Substituting 9144 for ???? as required?&lt;BR /&gt;&lt;BR /&gt;As far as I know, this regexp will match filenames&lt;BR /&gt;like    &lt;BR /&gt;        *_9144_[0-9]???_????.res&lt;BR /&gt;&lt;BR /&gt;9144 has to be the 2nd from last is what OP &lt;BR /&gt;asked for, if I understand correctly.&lt;BR /&gt;&lt;BR /&gt;- Biswajit&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 10 Jan 2005 13:29:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-for-test-field-qualifier/m-p/3459101#M848535</guid>
      <dc:creator>Biswajit Tripathy</dc:creator>
      <dc:date>2005-01-10T13:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: test for test field qualifier</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-for-test-field-qualifier/m-p/3459102#M848536</link>
      <description>Hi Fernando,&lt;BR /&gt;&lt;BR /&gt;Since the file names are of different length, you can write a script where you get the number of characters (using word count)in the file name. &lt;BR /&gt;For Eg:- for this file&lt;BR /&gt;BLF1820E-90_SemAuto_97211_9144_0310743.res&lt;BR /&gt;ls -l *_*_*_????_*.res | awk '{print $9}'| wc -c will give 43 as the number of characters in the name. And from the reverse side if you see there are a constant number of character which is 12, to get the 2nd last number. So have the word count in a variable and substract the constant 12 to get the 2nd last field.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Indira A&lt;BR /&gt;</description>
      <pubDate>Mon, 10 Jan 2005 20:43:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-for-test-field-qualifier/m-p/3459102#M848536</guid>
      <dc:creator>Indira Aramandla</dc:creator>
      <dc:date>2005-01-10T20:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: test for test field qualifier</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-for-test-field-qualifier/m-p/3459103#M848537</link>
      <description>Hi Fernando,&lt;BR /&gt;&lt;BR /&gt;1)BLF1820E-90_SemAuto_97211_9144_0310743.res&lt;BR /&gt;2)BLF177C_95442_9279_0510859.res&lt;BR /&gt;&lt;BR /&gt;I have written a smallscript taking your two files as example.&lt;BR /&gt;The variable filed2 will hold the value of the second last fields (9144 and 9279) for both files and then you can use the $filed2 variable as a qualifier.&lt;BR /&gt;&lt;BR /&gt;I hipe his helps&lt;BR /&gt;&lt;BR /&gt;Indira A&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Jan 2005 01:46:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-for-test-field-qualifier/m-p/3459103#M848537</guid>
      <dc:creator>Indira Aramandla</dc:creator>
      <dc:date>2005-01-11T01:46:32Z</dc:date>
    </item>
  </channel>
</rss>

