<?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: Read words from file and create new file using K-shell. in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/read-words-from-file-and-create-new-file-using-k-shell/m-p/4011174#M96323</link>
    <description>Hi OldSchool,&lt;BR /&gt;&lt;BR /&gt;Again thanks..&lt;BR /&gt;Yes, i need to make the output file as your first like guess.&lt;BR /&gt; &lt;BR /&gt;should this say&lt;BR /&gt;&lt;BR /&gt;SCHEMAS=0,01,02&lt;BR /&gt;INCLUDE=TABLE:"IN('T','T1','T2','T3')"&lt;BR /&gt;&lt;BR /&gt;I have added the table T3 in the output..&lt;BR /&gt;&lt;BR /&gt;Please let me know there are any quesitons.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;bsraj.</description>
    <pubDate>Sat, 02 Jun 2007 13:51:09 GMT</pubDate>
    <dc:creator>bsraj</dc:creator>
    <dc:date>2007-06-02T13:51:09Z</dc:date>
    <item>
      <title>Read words from file and create new file using K-shell.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/read-words-from-file-and-create-new-file-using-k-shell/m-p/4011166#M96315</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;Please help me in creating files through K-shell scripts.&lt;BR /&gt;I am having one file in this format.&lt;BR /&gt;OWNER.TABLE_NAME&lt;BR /&gt;OWNER.TABLE_NAME1&lt;BR /&gt;OWNER1.TABLE_NAME&lt;BR /&gt;OWNER1.TABLE_NAME1&lt;BR /&gt;&lt;BR /&gt;I want to read the above file and create new file through k shell script.&lt;BR /&gt;The new file should looks like this.&lt;BR /&gt;SCHEMAS=OWNER,OWNER1&lt;BR /&gt;INCLUDE=TABLE:"IN ('TABLE_NAME','TABLE_NAME1')"&lt;BR /&gt;&lt;BR /&gt;Please let me know there are any questions.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;bsraj.</description>
      <pubDate>Thu, 31 May 2007 19:24:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/read-words-from-file-and-create-new-file-using-k-shell/m-p/4011166#M96315</guid>
      <dc:creator>bsraj</dc:creator>
      <dc:date>2007-05-31T19:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: Read words from file and create new file using K-shell.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/read-words-from-file-and-create-new-file-using-k-shell/m-p/4011167#M96316</link>
      <description>I assume you want to take all of the names on the left of the ".", and sort -u them.&lt;BR /&gt;Then take all of the names on the right and do the same thing.  Then put out those two lines?&lt;BR /&gt;&lt;BR /&gt;I assume you don't care about the order of the lists of the first two lines and that you may output:&lt;BR /&gt;SCHEMAS=OWNER1,OWNER&lt;BR /&gt;INCLUDE=TABLE:"IN ('TABLE_NAME','TABLE_NAME1')"&lt;BR /&gt;&lt;BR /&gt;And that the total number of lines in the input files is S * I?</description>
      <pubDate>Thu, 31 May 2007 20:12:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/read-words-from-file-and-create-new-file-using-k-shell/m-p/4011167#M96316</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-05-31T20:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: Read words from file and create new file using K-shell.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/read-words-from-file-and-create-new-file-using-k-shell/m-p/4011168#M96317</link>
      <description>&lt;!--!*#--&gt;&amp;gt;&amp;gt; Please let me know there are any questions.&lt;BR /&gt;&lt;BR /&gt;Yeah, why not a perl or awk solution?&lt;BR /&gt;This is not a shell or scripting task, it is word processing task.&lt;BR /&gt;&lt;BR /&gt;In perl it could look like&lt;BR /&gt;&lt;BR /&gt;$cat x.txt&lt;BR /&gt;OWNER.TABLE_NAME&lt;BR /&gt;OWNER.TABLE_NAME1&lt;BR /&gt;OWNER1.TABLE_NAME&lt;BR /&gt;OWNER1.TABLE_NAME1&lt;BR /&gt;$cat x.pl&lt;BR /&gt;use strict;&lt;BR /&gt;my (%owners, %tables);&lt;BR /&gt;while (&amp;lt;&amp;gt;) {&lt;BR /&gt;  chomp;&lt;BR /&gt;  my ($o,$t) = split /\./;&lt;BR /&gt;  $owners{$o}++;&lt;BR /&gt;  $tables{$t}++;&lt;BR /&gt;}&lt;BR /&gt;my $owner_list = join q(,), sort keys %owners;&lt;BR /&gt;my $table_list = join q(','), sort keys %tables;&lt;BR /&gt;&lt;BR /&gt;print &amp;lt;&amp;lt;"EOF";&lt;BR /&gt;SCHEMAS=$owner_list&lt;BR /&gt;INCLUDE=TABLE:"IN ('$table_list')"&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;$perl x.pl x.txt&lt;BR /&gt;SCHEMAS=OWNER,OWNER1&lt;BR /&gt;INCLUDE=TABLE:"IN ('TABLE_NAME','TABLE_NAME1')"&lt;BR /&gt;&lt;BR /&gt;Cheers!&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 31 May 2007 21:24:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/read-words-from-file-and-create-new-file-using-k-shell/m-p/4011168#M96317</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-05-31T21:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: Read words from file and create new file using K-shell.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/read-words-from-file-and-create-new-file-using-k-shell/m-p/4011169#M96318</link>
      <description>&lt;!--!*#--&gt;Here is a script that uses awk, sort and the shell to produce your output:&lt;BR /&gt;&lt;BR /&gt;TMP=/var/tmp/itrc.sc.$$&lt;BR /&gt;awk -F. -v OUT2=${TMP}b '&lt;BR /&gt;{&lt;BR /&gt;print $1&lt;BR /&gt;print $2 &amp;gt;&amp;gt; OUT2&lt;BR /&gt;} ' input-file | sort -u &amp;gt; ${TMP}a&lt;BR /&gt;&lt;BR /&gt;sort -u -o ${TMP}b ${TMP}b&lt;BR /&gt;&lt;BR /&gt;IFS_SAVE=$IFS&lt;BR /&gt;&lt;BR /&gt;set -A SCH -- $(&amp;lt; ${TMP}a )&lt;BR /&gt;IFS=","&lt;BR /&gt;echo "SCHEMAS=${SCH[*]}"&lt;BR /&gt;&lt;BR /&gt;IFS=$IFS_SAVE&lt;BR /&gt;set -A SCH -- $(&amp;lt; ${TMP}b )&lt;BR /&gt;echo "INCLUDE=TABLE:\"IN ('\c"&lt;BR /&gt;&lt;BR /&gt;(( i = 0 ))&lt;BR /&gt;(( j = ${#SCH[*]} ))&lt;BR /&gt;while [ $i -lt $j ]; do&lt;BR /&gt;   echo "${SCH[i]}\c"&lt;BR /&gt;   (( i = i + 1 ))&lt;BR /&gt;   if [ $i -lt $j ]; then&lt;BR /&gt;      echo "','\c"&lt;BR /&gt;   fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;echo "')"\"&lt;BR /&gt;&lt;BR /&gt;rm -f ${TMP}a ${TMP}b</description>
      <pubDate>Thu, 31 May 2007 21:58:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/read-words-from-file-and-create-new-file-using-k-shell/m-p/4011169#M96318</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-05-31T21:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Read words from file and create new file using K-shell.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/read-words-from-file-and-create-new-file-using-k-shell/m-p/4011170#M96319</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Thanks a lot for your response...&lt;BR /&gt;Yes, you are correct.. Order is not a problem.&lt;BR /&gt;I will try with the awk script and let you if there are any issues.&lt;BR /&gt;In the script, i am not using the perl...&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;bsraj.</description>
      <pubDate>Fri, 01 Jun 2007 00:28:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/read-words-from-file-and-create-new-file-using-k-shell/m-p/4011170#M96319</guid>
      <dc:creator>bsraj</dc:creator>
      <dc:date>2007-06-01T00:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: Read words from file and create new file using K-shell.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/read-words-from-file-and-create-new-file-using-k-shell/m-p/4011171#M96320</link>
      <description>how about this?&lt;BR /&gt;&lt;BR /&gt;T1=`cat xxx|cut -d\. -f1|sort -u`&lt;BR /&gt;echo $T1| tr " " "," | \&lt;BR /&gt;sed 's|^|SCHEMAS=|g'&lt;BR /&gt;T1=`cat xxx|cut -d\. -f2|sort -u`&lt;BR /&gt;echo $T1| tr " " ","|sed \&lt;BR /&gt;-e"s|^|\'|g" \&lt;BR /&gt;-e"s|$|\'|g" \&lt;BR /&gt;-e"s|^|INCLUDE=TABLE:\"IN \(|g" \&lt;BR /&gt;-e"s|$|\)\"|g"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 01 Jun 2007 01:42:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/read-words-from-file-and-create-new-file-using-k-shell/m-p/4011171#M96320</guid>
      <dc:creator>Steve Faidley</dc:creator>
      <dc:date>2007-06-01T01:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: Read words from file and create new file using K-shell.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/read-words-from-file-and-create-new-file-using-k-shell/m-p/4011172#M96321</link>
      <description>do all owners each have the same tables, or is it possible for some owners to have tables the others dont?&lt;BR /&gt;&lt;BR /&gt;is it acceptable to generate a file that *says* all owners have all tables?&lt;BR /&gt;&lt;BR /&gt;for example&lt;BR /&gt;&lt;BR /&gt;O.T&lt;BR /&gt;0.T1&lt;BR /&gt;01.T&lt;BR /&gt;01.T1&lt;BR /&gt;02.T3&lt;BR /&gt;&lt;BR /&gt;should this say&lt;BR /&gt;&lt;BR /&gt;SCHEMAS=0,01,02&lt;BR /&gt;INCLUDE=TABLE:"IN('T','T1','T2')"&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;SCHEMAS=0,01&lt;BR /&gt;INCLUDE=TABLE:"IN('T','T1')"&lt;BR /&gt;SCHEMAS=02&lt;BR /&gt;INCLUDE=TABLE:"IN('T3')"</description>
      <pubDate>Fri, 01 Jun 2007 12:41:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/read-words-from-file-and-create-new-file-using-k-shell/m-p/4011172#M96321</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2007-06-01T12:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: Read words from file and create new file using K-shell.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/read-words-from-file-and-create-new-file-using-k-shell/m-p/4011173#M96322</link>
      <description>Hi Steve Faidley,&lt;BR /&gt;&lt;BR /&gt;Thanks for your response..&lt;BR /&gt;I am not sure how to modify ur code to get single codes after all the tables..&lt;BR /&gt;Could you please hele me to get that..&lt;BR /&gt;&lt;BR /&gt;The Output from the same code.&lt;BR /&gt;&lt;BR /&gt;SCHEMAS=OWNER,OWNER1&lt;BR /&gt;INCLUDE=TABLE:"IN ('TABLE_NAME,TABLE_NAME1')"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I like to get single codes after every table.&lt;BR /&gt;&lt;BR /&gt;SCHEMAS=OWNER,OWNER1&lt;BR /&gt;INCLUDE=TABLE:"IN ('TABLE_NAME','TABLE_NAME1')"&lt;BR /&gt;&lt;BR /&gt;Please let me know there are any quesitons.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;bsraj.</description>
      <pubDate>Sat, 02 Jun 2007 13:45:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/read-words-from-file-and-create-new-file-using-k-shell/m-p/4011173#M96322</guid>
      <dc:creator>bsraj</dc:creator>
      <dc:date>2007-06-02T13:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: Read words from file and create new file using K-shell.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/read-words-from-file-and-create-new-file-using-k-shell/m-p/4011174#M96323</link>
      <description>Hi OldSchool,&lt;BR /&gt;&lt;BR /&gt;Again thanks..&lt;BR /&gt;Yes, i need to make the output file as your first like guess.&lt;BR /&gt; &lt;BR /&gt;should this say&lt;BR /&gt;&lt;BR /&gt;SCHEMAS=0,01,02&lt;BR /&gt;INCLUDE=TABLE:"IN('T','T1','T2','T3')"&lt;BR /&gt;&lt;BR /&gt;I have added the table T3 in the output..&lt;BR /&gt;&lt;BR /&gt;Please let me know there are any quesitons.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;bsraj.</description>
      <pubDate>Sat, 02 Jun 2007 13:51:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/read-words-from-file-and-create-new-file-using-k-shell/m-p/4011174#M96323</guid>
      <dc:creator>bsraj</dc:creator>
      <dc:date>2007-06-02T13:51:09Z</dc:date>
    </item>
  </channel>
</rss>

