<?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: Filter records from Input File in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857945#M773465</link>
    <description>Hi Sandman,&lt;BR /&gt;&lt;BR /&gt;Your script working.. except final echo $j&lt;BR /&gt;removing all extra spaces within every column from particular record&lt;BR /&gt;&lt;BR /&gt;if a column is 80 bytes and has values for &lt;BR /&gt;only 40 bytes ..rest will be blanks/spaces....but your code echos 40 bytes then one space and prints next columns.... basically length of whole record &lt;BR /&gt;is shrinked.  PLS HELP !!!&lt;BR /&gt;&lt;BR /&gt;while read i&lt;BR /&gt;do&lt;BR /&gt;while read j&lt;BR /&gt;do&lt;BR /&gt;str=$(echo $j | awk '{print z[split($1,z,"[A-Z]")]}')&lt;BR /&gt;if [[ $i = $str ]]; then&lt;BR /&gt;echo $j&lt;BR /&gt;fi&lt;BR /&gt;done &amp;lt; f1&lt;BR /&gt;done &amp;lt; f2</description>
    <pubDate>Tue, 26 Sep 2006 20:14:13 GMT</pubDate>
    <dc:creator>uform</dc:creator>
    <dc:date>2006-09-26T20:14:13Z</dc:date>
    <item>
      <title>Filter records from Input File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857930#M773450</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;File 1&lt;BR /&gt;Record1: AAAERTD778 Q 100 DFGD 5676&lt;BR /&gt;Record2: AAAERTD558 Q 100 DFGD 323&lt;BR /&gt;Record3: AAAERTD448 Q 100 DFGD 778&lt;BR /&gt;Record4: AAAERTD178 Q 100 DFGD 5626&lt;BR /&gt;Record5: AAAERTD323 Q 100 DFGD 736&lt;BR /&gt;&lt;BR /&gt;File 2&lt;BR /&gt;778&lt;BR /&gt;323&lt;BR /&gt;&lt;BR /&gt;My requirement is to open File 2. Read line by line and search for the pattern in File 1.&lt;BR /&gt;That too patern should match only in first column.&lt;BR /&gt;&lt;BR /&gt;For eg. If i take 778 from File 2 and do a general grep in File 1, it returns Records 1 and 3.But i need it to return only Record 1.&lt;BR /&gt;&lt;BR /&gt;Problem is ,&lt;BR /&gt;&lt;BR /&gt;1) If i just say grep for 778 and redirect output to another file it writes  records 1 and 3 into new file.&lt;BR /&gt;&lt;BR /&gt;2) If i cut first column and do the grep then &lt;BR /&gt;redirect output to another file it writes  only the first column. But i need to write the whole record.&lt;BR /&gt;&lt;BR /&gt;So i followed 2nd method and got the line nos using grep -n. Then again i looped based on physical line no and got the final output as what i needed. But i feel there should be a eay way to do it.&lt;BR /&gt;&lt;BR /&gt;PLS HELP !!  ONLY Shell script. NO PERL PLS.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Sep 2006 15:05:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857930#M773450</guid>
      <dc:creator>uform</dc:creator>
      <dc:date>2006-09-06T15:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records from Input File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857931#M773451</link>
      <description>Also File 2 may not always have a 3 digit no.&lt;BR /&gt;&lt;BR /&gt;AND &lt;BR /&gt;&lt;BR /&gt;File 1 may not have same length in first column...  it may be AAAERTD778  or &lt;BR /&gt;XYHAERT123778 or HAERT99978.</description>
      <pubDate>Wed, 06 Sep 2006 15:15:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857931#M773451</guid>
      <dc:creator>uform</dc:creator>
      <dc:date>2006-09-06T15:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records from Input File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857932#M773452</link>
      <description>A variety of ways to attack this. The easiest, if the data in column 1 is always prefixed by AAAERTD, is adjusting your grep to the following should get you what you want:&lt;BR /&gt;&lt;BR /&gt;for NUMBER in $(cat file2)&lt;BR /&gt;do&lt;BR /&gt;  grep AAAERTD${NUMBER} file1 &amp;gt; ${NUMBER}.output&lt;BR /&gt;done</description>
      <pubDate>Wed, 06 Sep 2006 15:16:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857932#M773452</guid>
      <dc:creator>Jeff_Traigle</dc:creator>
      <dc:date>2006-09-06T15:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records from Input File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857933#M773453</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;No Perl, too bad.  OK, so create a read loop to read 'file2' and use its tokens as arguments to 'awk'.  Something like:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;while read TOKEN &lt;BR /&gt;do&lt;BR /&gt;    awk -v TOKEN=${TOKEN} '$2~TOKEN {print}' file1&lt;BR /&gt;done &amp;lt; file2&lt;BR /&gt;&lt;BR /&gt;Note that 'awk' counts fileds one-relative.  Hence, $2 is awk's *first* whitespace-delimited field.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 06 Sep 2006 15:19:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857933#M773453</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-09-06T15:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records from Input File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857934#M773454</link>
      <description>Ok. so you complicate it a bit with that requirement. :) Change the grep to the following:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;grep -E "[A-Z]*${NUMBER} " file1 &amp;gt; ${NUMBER}.output</description>
      <pubDate>Wed, 06 Sep 2006 15:28:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857934#M773454</guid>
      <dc:creator>Jeff_Traigle</dc:creator>
      <dc:date>2006-09-06T15:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records from Input File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857935#M773455</link>
      <description>grep -E "[A-Z]*${NUMBER} " file1 &amp;gt; ${NUMBER}.output&lt;BR /&gt;&lt;BR /&gt;will this not pickup Record 1 and 3 if the search string is 778 ?</description>
      <pubDate>Wed, 06 Sep 2006 16:07:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857935#M773455</guid>
      <dc:creator>uform</dc:creator>
      <dc:date>2006-09-06T16:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records from Input File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857936#M773456</link>
      <description>&lt;BR /&gt;Easy... just have a first awk command generate the right awk program, then execute:&lt;BR /&gt;&lt;BR /&gt;$ cat x.1&lt;BR /&gt;AAAERTD778 Q 100 DFGD 5676&lt;BR /&gt;AAAERTD558 Q 100 DFGD 323&lt;BR /&gt;AAAERTD448 Q 100 DFGD 778&lt;BR /&gt;AAAERTD178 Q 100 DFGD 5626&lt;BR /&gt;AAAERTD323 Q 100 DFGD 736&lt;BR /&gt;&lt;BR /&gt;$ cat x.2&lt;BR /&gt;778&lt;BR /&gt;323&lt;BR /&gt;$ awk '{print "/^[A-Z]*" $1 "/"}' x.2 &amp;gt; /tmp/tmp_$$.awk&lt;BR /&gt;$ awk -f /tmp/tmp_$$.awk x.1&lt;BR /&gt;AAAERTD778 Q 100 DFGD 5676&lt;BR /&gt;AAAERTD323 Q 100 DFGD 736&lt;BR /&gt;$ rm /tmp/tmp_$$.awk x.1&lt;BR /&gt;&lt;BR /&gt;For sake of completeness the helper looks like:&lt;BR /&gt;$ awk '{print "/^[A-Z]*" $1 " /"}' x.2&lt;BR /&gt;/^[A-Z]*778/&lt;BR /&gt;/^[A-Z]*323/&lt;BR /&gt;&lt;BR /&gt;So it looks for lines starting with a bunch on characters from A to Z, followed by a specific number as found in the second file, followed by a space. If found, take the non-specified, default action, which is print the current line.&lt;BR /&gt;&lt;BR /&gt;Hein &lt;BR /&gt;HvdH Performance Consulting</description>
      <pubDate>Wed, 06 Sep 2006 20:53:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857936#M773456</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-09-06T20:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records from Input File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857937#M773457</link>
      <description>Here's a short one-line awk construct that does what you're looking for:&lt;BR /&gt;&lt;BR /&gt;f1 contains...&lt;BR /&gt;AAAERTD778 Q 100 DFGD 5676&lt;BR /&gt;AAAERTD558 Q 100 DFGD 323&lt;BR /&gt;AAAERTD448 Q 100 DFGD 778&lt;BR /&gt;AAAERTD178 Q 100 DFGD 5626&lt;BR /&gt;AAAERTD323 Q 100 DFGD 736&lt;BR /&gt;&lt;BR /&gt;f2 contains...&lt;BR /&gt;778&lt;BR /&gt;323&lt;BR /&gt;&lt;BR /&gt;awk '{if($1~/^[A-Z]/){n=z[split($1,z,"[A-Z]")];x[n]=$0}for(i in x) if(i==$1)print x[i]}' f1 f2&lt;BR /&gt;&lt;BR /&gt;~cheers</description>
      <pubDate>Thu, 07 Sep 2006 00:59:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857937#M773457</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-09-07T00:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records from Input File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857938#M773458</link>
      <description>&lt;!--!*#--&gt;...and here's the indented version for clarity:&lt;BR /&gt;&lt;BR /&gt;awk '{&lt;BR /&gt;    if ($1~/^[A-Z]/) {&lt;BR /&gt;        n = z[split($1,z,"[A-Z]")]&lt;BR /&gt;        x[n] = $0&lt;BR /&gt;    }&lt;BR /&gt;    for (i in x)&lt;BR /&gt;        if (i == $1)&lt;BR /&gt;            print x[i]&lt;BR /&gt;}' f1 f2</description>
      <pubDate>Thu, 07 Sep 2006 01:28:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857938#M773458</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-09-07T01:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records from Input File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857939#M773459</link>
      <description>Hi,&lt;BR /&gt;Here's a short one-line ksh construct that does what you're looking for:&lt;BR /&gt;&lt;BR /&gt;f1 contains...&lt;BR /&gt;AAAERTD778 Q 100 DFGD 5676&lt;BR /&gt;AAAERTD558 Q 100 DFGD 323&lt;BR /&gt;AAAERTD448 Q 100 DFGD 778&lt;BR /&gt;AAAERTD178 Q 100 DFGD 5626&lt;BR /&gt;AAAERTD323 Q 100 DFGD 736&lt;BR /&gt;&lt;BR /&gt;f2 contains...&lt;BR /&gt;778&lt;BR /&gt;323&lt;BR /&gt;&lt;BR /&gt;xargs&lt;F2 -i="" grep="" -e=""&gt;&lt;/F2&gt;Record1: AAAERTD778 Q 100 DFGD 5676&lt;BR /&gt;Record5: AAAERTD323 Q 100 DFGD 736&lt;BR /&gt;&lt;BR /&gt;This look for key in file f2 there are in file f1 at the bgininng preceded by any chars and terminated by blank&lt;BR /&gt;HTH,&lt;BR /&gt;Art&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Sep 2006 03:46:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857939#M773459</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2006-09-07T03:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records from Input File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857940#M773460</link>
      <description>I think we have beaten this hors to dead by now, but want to give a quick comment though...&lt;BR /&gt;&lt;BR /&gt;Sandman,&lt;BR /&gt;&lt;BR /&gt;Your solution creates a large array with all of file1 does it not? And it will find only one match, even if there were 2 lines in file1 for a given file2 entry.&lt;BR /&gt;&lt;BR /&gt;I would suggest to flip the files around:&lt;BR /&gt;&lt;BR /&gt;awk "/^[0-9]*/{x[$1]=1} /^[A-Z]/ {n=z[split($1,z,\"[A-Z]\")]; if (x[n]) print}" 2.tmp 1.tmp&lt;BR /&gt;&lt;BR /&gt;1) if the line starts wit a number, set a flag for that number in an array.&lt;BR /&gt;2) if the line starts with letter, split away a number part. If that number is flagged in the array, print the line.&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Sep 2006 10:00:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857940#M773460</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-09-07T10:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records from Input File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857941#M773461</link>
      <description>Sorry folks for responding so late...i forgot the user id , pwd for this site and had a tuff time finding it. :)&lt;BR /&gt;&lt;BR /&gt;anyways ...  regarding this question.&lt;BR /&gt;&lt;BR /&gt;I would like to reiterate the question one more time...&lt;BR /&gt;&lt;BR /&gt;1) I want to open File 2, read line by line&lt;BR /&gt;and then search for that string in File 1's first column.  I see many mentioning A-Z,0-9&lt;BR /&gt;etc... i dont want to stick on to that way...&lt;BR /&gt;whatever the start and end of column one be(even special characters, all i need is the search string should be in FIRST column of file 1. so may be it will be good to just cut the column one and search in it.&lt;BR /&gt;&lt;BR /&gt;2) grep -E or grep -e not working for me &lt;BR /&gt;@lib&amp;gt;grep -e&lt;BR /&gt;grep: illegal option -- e&lt;BR /&gt;Usage: grep -hblcnsviw pattern file . . .&lt;BR /&gt;@lib&amp;gt;grep -E&lt;BR /&gt;grep: illegal option -- E&lt;BR /&gt;Usage: grep -hblcnsviw pattern file . . .&lt;BR /&gt;&lt;BR /&gt;Thanks for all your replies and patience.</description>
      <pubDate>Thu, 14 Sep 2006 14:26:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857941#M773461</guid>
      <dc:creator>uform</dc:creator>
      <dc:date>2006-09-14T14:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records from Input File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857942#M773462</link>
      <description>Based on your last post...here's a shell script that does what you're looking for:&lt;BR /&gt;&lt;BR /&gt;while read i&lt;BR /&gt;do&lt;BR /&gt;   while read j&lt;BR /&gt;   do&lt;BR /&gt;      str=$(echo $j | awk '{print z[split($1,z,"[A-Z]")]}')&lt;BR /&gt;      if [[ $i = $str ]]; then&lt;BR /&gt;          echo $j&lt;BR /&gt;      fi&lt;BR /&gt;   done &amp;lt; f1&lt;BR /&gt;done &amp;lt; f2</description>
      <pubDate>Thu, 14 Sep 2006 17:57:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857942#M773462</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-09-14T17:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records from Input File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857943#M773463</link>
      <description>Script attached as part of it got cut-off in my last post due to copy 'n paste.&lt;BR /&gt;&lt;BR /&gt;cheers!</description>
      <pubDate>Thu, 14 Sep 2006 18:07:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857943#M773463</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-09-14T18:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records from Input File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857944#M773464</link>
      <description>Ah, we read too much in too little description.&lt;BR /&gt;&lt;BR /&gt;I still kinda like the two-stage approach.&lt;BR /&gt;Short and sweet. Try this:&lt;BR /&gt;&lt;BR /&gt;# cat x.1&lt;BR /&gt;AAAERTD778 Q 100 DFGD 5676&lt;BR /&gt;AAAERTD558 Q 100 DFGD 323&lt;BR /&gt;AAAERTD448 Q 100 DFGD 778&lt;BR /&gt;AAAERTD178 Q 100 DFGD 5626&lt;BR /&gt;AAAERTD323 Q 100 DFGD 736&lt;BR /&gt;# cat x.2&lt;BR /&gt;TD1&lt;BR /&gt;558&lt;BR /&gt;#&lt;BR /&gt;# awk '{print "$1 ~ /" $1 "/"}' x.2 &amp;gt; tmp.awk&lt;BR /&gt;# awk -f tmp.awk x.1&lt;BR /&gt;AAAERTD558 Q 100 DFGD 323&lt;BR /&gt;AAAERTD178 Q 100 DFGD 5626&lt;BR /&gt;&lt;BR /&gt;For sake of completeness, the help file was:&lt;BR /&gt;# cat tmp.awk&lt;BR /&gt;$1 ~ /TD1/&lt;BR /&gt;$1 ~ /558/&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Thu, 14 Sep 2006 20:58:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857944#M773464</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-09-14T20:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records from Input File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857945#M773465</link>
      <description>Hi Sandman,&lt;BR /&gt;&lt;BR /&gt;Your script working.. except final echo $j&lt;BR /&gt;removing all extra spaces within every column from particular record&lt;BR /&gt;&lt;BR /&gt;if a column is 80 bytes and has values for &lt;BR /&gt;only 40 bytes ..rest will be blanks/spaces....but your code echos 40 bytes then one space and prints next columns.... basically length of whole record &lt;BR /&gt;is shrinked.  PLS HELP !!!&lt;BR /&gt;&lt;BR /&gt;while read i&lt;BR /&gt;do&lt;BR /&gt;while read j&lt;BR /&gt;do&lt;BR /&gt;str=$(echo $j | awk '{print z[split($1,z,"[A-Z]")]}')&lt;BR /&gt;if [[ $i = $str ]]; then&lt;BR /&gt;echo $j&lt;BR /&gt;fi&lt;BR /&gt;done &amp;lt; f1&lt;BR /&gt;done &amp;lt; f2</description>
      <pubDate>Tue, 26 Sep 2006 20:14:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857945#M773465</guid>
      <dc:creator>uform</dc:creator>
      <dc:date>2006-09-26T20:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records from Input File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857946#M773466</link>
      <description>&amp;gt;Your script working.. except final echo $j removing all extra spaces within &amp;gt;every column from particular record&lt;BR /&gt;&lt;BR /&gt;&amp;gt;if a column is 80 bytes and has values for only 40 bytes ..rest will be &amp;gt;blanks/spaces....but your code echos 40 bytes then one space and prints next &amp;gt;columns.... basically length of whole record is shrinked.&lt;BR /&gt;&lt;BR /&gt;If you need to print the trailing spaces for every record then you need to set the internal field separator (IFS) to something other than a space. This way the echo $j command will capture and print everything, including the trailing spaces. See the script attached to this post:&lt;BR /&gt;&lt;BR /&gt;~cheers</description>
      <pubDate>Tue, 26 Sep 2006 22:37:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857946#M773466</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-09-26T22:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records from Input File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857947#M773467</link>
      <description>&amp;gt;&amp;gt;&amp;gt; PLS HELP !!!&lt;BR /&gt;&lt;BR /&gt;Did you try my last suggested solution?&lt;BR /&gt;&lt;BR /&gt;It would retain spaces, and I suspect it will be relatively fast, which may be important for large data volumes.&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Tue, 26 Sep 2006 23:16:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857947#M773467</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-09-26T23:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records from Input File</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857948#M773468</link>
      <description>Sandman,&lt;BR /&gt;&lt;BR /&gt;Your code worked with that IFS=":"  ... but for large data it just hung.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hein,&lt;BR /&gt;&lt;BR /&gt;Sorry i was concentrating on sandman's code.&lt;BR /&gt;YOUR CODE WORKED !!  even for large data. cool.&lt;BR /&gt;&lt;BR /&gt;Thanks to ALL</description>
      <pubDate>Wed, 27 Sep 2006 11:00:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filter-records-from-input-file/m-p/3857948#M773468</guid>
      <dc:creator>uform</dc:creator>
      <dc:date>2006-09-27T11:00:43Z</dc:date>
    </item>
  </channel>
</rss>

