<?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: Reading two files with awk in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/reading-two-files-with-awk/m-p/4314574#M683147</link>
    <description>&lt;!--!*#--&gt;Hi Chris:&lt;BR /&gt;&lt;BR /&gt;There is a spelling inconsistency in your file in the script and the external post.  Either "LDC_Snapshot_Status.ini" or "LDC_Snapshot_Status.in".&lt;BR /&gt;&lt;BR /&gt;You are lacking a number of opening and closing braces too.&lt;BR /&gt;&lt;BR /&gt;You need to *close* the "NUM_CORR" file at the end of the 'while' loop that reads it for every iteration of the outer 'while' loop that reads the "LDC*" file.&lt;BR /&gt;&lt;BR /&gt;awk '{&lt;BR /&gt;{&lt;BR /&gt;  while ((getline b_n &amp;lt; "LDC_Snapshot_Status.in") &amp;gt; 0) {&lt;BR /&gt;    while( getline line &amp;lt; "NUM_CORR" &amp;gt; 0 ) {&lt;BR /&gt;      if (line~/:/) {&lt;BR /&gt;        split(line,as," ")&lt;BR /&gt;        print echo "Call from "as[1]" to "as[2]" in "as[8]" is in progress for "as[7]" days since "as[3]" to date. ""Please forward this mail to the relevant persons." "| mailx -s " "\"LDC_Snapshot_Status\" " b_n&lt;BR /&gt;      }&lt;BR /&gt;    }&lt;BR /&gt;  close "NUM_CORR"&lt;BR /&gt;  }&lt;BR /&gt;}' NUM_CORR&lt;BR /&gt;&lt;BR /&gt;...try this variation.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Thu, 27 Nov 2008 17:13:07 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2008-11-27T17:13:07Z</dc:date>
    <item>
      <title>Reading two files with awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reading-two-files-with-awk/m-p/4314573#M683146</link>
      <description>&lt;BR /&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I have a problem in reading file 1 , which consist of data and file 2 which has the e-mail address&lt;BR /&gt;&lt;BR /&gt;Script&lt;BR /&gt;======&lt;BR /&gt;&lt;BR /&gt; awk '{        &lt;BR /&gt;                while ((getline b_n &amp;lt; "LDC_Snapshot_Status.ini") &amp;gt; 0)        &lt;BR /&gt;                        while( getline line &amp;lt; "NUM_CORR" &amp;gt; 0 )  &lt;BR /&gt;                        if(line~/:/){&lt;BR /&gt;                        split(line,as," ")&lt;BR /&gt;        print echo "Call from "as[1]" to "as[2]" in "as[8]" is in progress for "as[7]" days since "as[3]" to date. ""Please forward this mail to the relevant persons." "| mailx -s " "\"LDC_Snapshot_Status\" " b_n &lt;BR /&gt;        }' NUM_CORR &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;NUM_CORR&lt;BR /&gt;========&lt;BR /&gt;00260976007053                0112101104                     2008/11/01 00:21:03       2008/11/26 22:21:04                26 rjdf:01    &lt;BR /&gt;00260976007053                0112101105                     2008/11/18 00:29:12       2008/11/26 22:29:13                 8 rjnl:01    &lt;BR /&gt;&lt;BR /&gt;LDC_Snapshot_Status.in&lt;BR /&gt;======================&lt;BR /&gt;me@mail.com&lt;BR /&gt;you@mail.com&lt;BR /&gt;&lt;BR /&gt;The result should look like&lt;BR /&gt;============================&lt;BR /&gt;&lt;BR /&gt;Call from 00260976007053 to 0112101104 in rjdf:01 is in progress for 26 days since 2008/11/01 to date. Please forward this mail to the relevant persons.| mailx -s "LDC_Snapshot_Status" me@mail.com&lt;BR /&gt;Call from 00260976007053 to 0112101104 in rjdf:01 is in progress for 26 days since 2008/11/01 to date. Please forward this mail to the relevant persons.| mailx -s "LDC_Snapshot_Status" you@mail.com&lt;BR /&gt;Call from 00260976007053 to 0112101105 in rjnl:01 is in progress for 8 days since 2008/11/18 to date. Please forward this mail to the relevant persons.| mailx -s "LDC_Snapshot_Status" me@mail.com&lt;BR /&gt;Call from 00260976007053 to 0112101105 in rjnl:01 is in progress for 8 days since 2008/11/18 to date. Please forward this mail to the relevant persons.| mailx -s "LDC_Snapshot_Status" you@mail.com&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Chris&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Nov 2008 16:29:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reading-two-files-with-awk/m-p/4314573#M683146</guid>
      <dc:creator>Chris Frangandonis</dc:creator>
      <dc:date>2008-11-27T16:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: Reading two files with awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reading-two-files-with-awk/m-p/4314574#M683147</link>
      <description>&lt;!--!*#--&gt;Hi Chris:&lt;BR /&gt;&lt;BR /&gt;There is a spelling inconsistency in your file in the script and the external post.  Either "LDC_Snapshot_Status.ini" or "LDC_Snapshot_Status.in".&lt;BR /&gt;&lt;BR /&gt;You are lacking a number of opening and closing braces too.&lt;BR /&gt;&lt;BR /&gt;You need to *close* the "NUM_CORR" file at the end of the 'while' loop that reads it for every iteration of the outer 'while' loop that reads the "LDC*" file.&lt;BR /&gt;&lt;BR /&gt;awk '{&lt;BR /&gt;{&lt;BR /&gt;  while ((getline b_n &amp;lt; "LDC_Snapshot_Status.in") &amp;gt; 0) {&lt;BR /&gt;    while( getline line &amp;lt; "NUM_CORR" &amp;gt; 0 ) {&lt;BR /&gt;      if (line~/:/) {&lt;BR /&gt;        split(line,as," ")&lt;BR /&gt;        print echo "Call from "as[1]" to "as[2]" in "as[8]" is in progress for "as[7]" days since "as[3]" to date. ""Please forward this mail to the relevant persons." "| mailx -s " "\"LDC_Snapshot_Status\" " b_n&lt;BR /&gt;      }&lt;BR /&gt;    }&lt;BR /&gt;  close "NUM_CORR"&lt;BR /&gt;  }&lt;BR /&gt;}' NUM_CORR&lt;BR /&gt;&lt;BR /&gt;...try this variation.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 27 Nov 2008 17:13:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reading-two-files-with-awk/m-p/4314574#M683147</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-11-27T17:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Reading two files with awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reading-two-files-with-awk/m-p/4314575#M683148</link>
      <description>Hi James,&lt;BR /&gt;&lt;BR /&gt;Thanks it works. The problem with spelling and braces was due to copy and paste ... &lt;BR /&gt;&lt;BR /&gt;Small mistake in your script&lt;BR /&gt;&lt;BR /&gt;awk '{&lt;BR /&gt;{ &amp;lt;------- and additional braces&lt;BR /&gt;&lt;BR /&gt;Thanks a lot&lt;BR /&gt;&lt;BR /&gt;Chris</description>
      <pubDate>Thu, 27 Nov 2008 17:23:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reading-two-files-with-awk/m-p/4314575#M683148</guid>
      <dc:creator>Chris Frangandonis</dc:creator>
      <dc:date>2008-11-27T17:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: Reading two files with awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reading-two-files-with-awk/m-p/4314576#M683149</link>
      <description>&lt;!--!*#--&gt;Hi (again) Chris:&lt;BR /&gt;&lt;BR /&gt;It would be cleaner, given that you explicitly read both files, to wrap the script in a BEGIN block and eliminate the useless read of NUM_CORR.  Something like:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/awk -f&lt;BR /&gt;BEGIN {&lt;BR /&gt;  while ((getline b_n &amp;lt; "LDC_Snapshot_Status.in") &amp;gt; 0) {&lt;BR /&gt;    while( getline line &amp;lt; "NUM_CORR" &amp;gt; 0 ) {&lt;BR /&gt;      if (line~/:/) {&lt;BR /&gt;        split(line,as," ")&lt;BR /&gt;        print echo "Call from "as[1]" to "as[2]" in "as[8]" is in progress for "as[7]" days since "as[3]" to date. ""Please forward this mail to the relevant persons." "| mailx -s " "\"LDC_Snapshot_Status\" " b_n&lt;BR /&gt;      }&lt;BR /&gt;    }&lt;BR /&gt;  close "NUM_CORR"&lt;BR /&gt;  }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 27 Nov 2008 17:44:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reading-two-files-with-awk/m-p/4314576#M683149</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-11-27T17:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Reading two files with awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reading-two-files-with-awk/m-p/4314577#M683150</link>
      <description>Hi James ,&lt;BR /&gt;&lt;BR /&gt;Thanks , have done&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Chris</description>
      <pubDate>Thu, 27 Nov 2008 17:56:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reading-two-files-with-awk/m-p/4314577#M683150</guid>
      <dc:creator>Chris Frangandonis</dc:creator>
      <dc:date>2008-11-27T17:56:24Z</dc:date>
    </item>
  </channel>
</rss>

