<?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: Simple Shell Script problem in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-shell-script-problem/m-p/4440986#M664264</link>
    <description>That worked!&lt;BR /&gt;&lt;BR /&gt;Many Thanks!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Marcus.</description>
    <pubDate>Wed, 17 Jun 2009 03:27:48 GMT</pubDate>
    <dc:creator>Marcus Antonius</dc:creator>
    <dc:date>2009-06-17T03:27:48Z</dc:date>
    <item>
      <title>Simple Shell Script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-shell-script-problem/m-p/4440982#M664260</link>
      <description>&lt;!--!*#--&gt;I am trying to read a file that has two columns of data in it. The data is related horizontally. &lt;BR /&gt;&lt;BR /&gt;I need to build a command using the values from each columns. For example:&lt;BR /&gt; My file looks like this:&lt;BR /&gt;&lt;BR /&gt;Data1        Data2&lt;BR /&gt;Data3        Data4&lt;BR /&gt;Data5        Data6&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I need to create a command that looks like this:&lt;BR /&gt;&lt;BR /&gt;Dosomething Data1,Data2 &lt;BR /&gt;&lt;BR /&gt;My problem is my script simply reads the whol column and attempts to put it all on the command line.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Any help will be appreciated.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Marcus</description>
      <pubDate>Tue, 16 Jun 2009 22:12:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-shell-script-problem/m-p/4440982#M664260</guid>
      <dc:creator>Marcus Antonius</dc:creator>
      <dc:date>2009-06-16T22:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Shell Script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-shell-script-problem/m-p/4440983#M664261</link>
      <description>Hi Marcus:&lt;BR /&gt;&lt;BR /&gt;This is one option:&lt;BR /&gt;&lt;BR /&gt;# cat ./reformat&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;while read X Y Z&lt;BR /&gt;do&lt;BR /&gt;    echo "somecommand ${X},${Y}"&lt;BR /&gt;done &amp;lt; inputfile&lt;BR /&gt;&lt;BR /&gt;# cat ./inputfile&lt;BR /&gt;Data1        Data2&lt;BR /&gt;Data3        Data4&lt;BR /&gt;Data5        Data6&lt;BR /&gt;&lt;BR /&gt;# ./reformat&lt;BR /&gt;somecommand Data1,Data2&lt;BR /&gt;somecommand Data3,Data4&lt;BR /&gt;somecommand Data5,Data6&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Jun 2009 22:38:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-shell-script-problem/m-p/4440983#M664261</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-06-16T22:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Shell Script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-shell-script-problem/m-p/4440984#M664262</link>
      <description>&lt;!--!*#--&gt;James,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks for the quick response!  Your solution has got me almost there.  I left a small detail out of my original post.&lt;BR /&gt;&lt;BR /&gt;I need two things:  &lt;BR /&gt;&lt;BR /&gt;1. The data columns in the file are reversed for the command I am trying to build for example:&lt;BR /&gt;I the file the data is arranged as below:&lt;BR /&gt;     Data1  Data2 &lt;BR /&gt;     Data3  Data4&lt;BR /&gt;     etc . . .&lt;BR /&gt;&lt;BR /&gt;However my command requires the data be arranged with column 2's data first and then column 1.  For example:&lt;BR /&gt;&lt;BR /&gt;somecommand Data2,Data1&lt;BR /&gt;somecommand Data4,Data3&lt;BR /&gt;somecommand Data6,Data5  etc. . .&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Also the final command requires some quotation marks for example: somecommand "Data2","Data1"  etc . . .&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;Marcus.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Jun 2009 23:04:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-shell-script-problem/m-p/4440984#M664262</guid>
      <dc:creator>Marcus Antonius</dc:creator>
      <dc:date>2009-06-16T23:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Shell Script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-shell-script-problem/m-p/4440985#M664263</link>
      <description>&lt;!--!*#--&gt;Hi Marcus:&lt;BR /&gt;&lt;BR /&gt;OK, according to your new requirements, simply do:&lt;BR /&gt;&lt;BR /&gt;# cat ./reformat&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;while read X Y Z&lt;BR /&gt;do&lt;BR /&gt;    echo "somecommand \"${Y}\",\"${X}\""&lt;BR /&gt;done &amp;lt; inputfile&lt;BR /&gt;&lt;BR /&gt;...which produces:&lt;BR /&gt;&lt;BR /&gt;somecommand "Data2","Data1"&lt;BR /&gt;somecommand "Data4","Data3"&lt;BR /&gt;somecommand "Data6","Data5"&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Jun 2009 23:10:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-shell-script-problem/m-p/4440985#M664263</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-06-16T23:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Shell Script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-shell-script-problem/m-p/4440986#M664264</link>
      <description>That worked!&lt;BR /&gt;&lt;BR /&gt;Many Thanks!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Marcus.</description>
      <pubDate>Wed, 17 Jun 2009 03:27:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-shell-script-problem/m-p/4440986#M664264</guid>
      <dc:creator>Marcus Antonius</dc:creator>
      <dc:date>2009-06-17T03:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Shell Script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-shell-script-problem/m-p/4440987#M664265</link>
      <description>if you like awk&lt;BR /&gt;&lt;BR /&gt;awk '{print "Dosomething", $1, "," $2}' yourfile&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 17 Jun 2009 04:55:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-shell-script-problem/m-p/4440987#M664265</guid>
      <dc:creator>Basheer_2</dc:creator>
      <dc:date>2009-06-17T04:55:11Z</dc:date>
    </item>
  </channel>
</rss>

