Visit Our UNIX and Linux User Community


Need help


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need help
# 1  
Old 09-16-2009
Need help

Hello All,

I need to group the rules into a single line. Please help me to solve this.

Below is the sample rule file
Code:
$ cat Rule.txt
<Rule field="PossDupFlag" value="Y" >
      <Rule expression="SendingTime  - OrigSendingTime  &gt; 36000000">
               <Set
                        field="Text"
                         expression="SendingTime - OrigSendingTime"
                         override="true"
                />
                <Set
                        field="MessageErrors"
                        value="Delta between tag 52 and tag 122 is GT 10 hours"
                         override="true"
                 />
        </Rule>
        <Rule field="OrdStatus" value="2" >
            <Copy
                   field="ExecType"
                   from="OrdStatus"
                   override="true"
             />
          </Rule>
</Rule>
<Rule>
         <Set
                  field="Account"
                  value="PERS"
                  override="true"
          />
         <Clear field="LastCapacity" />
 </Rule>
 <Rule field="LastMkt" value="N" >
           <Set
                  field="LastMkt"
                  value="A"
                  override="true"
           />
 </Rule>
 <Rule expression="DeliverToCompID IS NULL" invert="true" >
           <Copy
                 field="OnBehalfOfCompID"
                 from="DeliverToCompID"
                 override="true"
           />
           <Clear field="DeliverToCompID"/>
</Rule>

Output should be in the format as ,
Code:
<Rule field="PossDupFlag" value="Y" ><Rule expression="SendingTime  - OrigSendingTime  &gt; 36000000"><Set field="Text" expression="SendingTime - OrigSendingTime" override="true" /><Set field="MessageErrors" value="Delta between tag 52 and tag 122 is GT 10 hours" override="true" /></Rule></Rule>
<Rule field="PossDupFlag" value="Y" ><Rule field="OrdStatus" value="2" > <Copy field="ExecType" from="OrdStatus" override="true" /> </Rule> </Rule>
<Rule><Set field="Account" value="PERS" override="true" /><Clear field="LastCapacity" /></Rule>
<Rule field="LastMkt" value="N" ><Set field="LastMkt" value="A" override="true" /></Rule>
<Rule expression="DeliverToCompID IS NULL" invert="true" ><Copy field="OnBehalfOfCompID" from="DeliverToCompID" override="true" /><Clear field="DeliverToCompID"/></Rule>

Thanks.

Last edited by manosubsulo; 09-17-2009 at 06:56 AM..
# 2  
Old 09-16-2009
Hello,

Per our forum rules, all threads must have a descriptive subject text. For example, do not post questions with subjects like "Help Me!", "Urgent!!" or "Doubt". Post subjects like "Execution Problems with Cron" or "Help with Backup Shell Script".

The reason for this is that nearly 95% of all visitors to this site come here because they are referred by a search engine. In order for future searches on your post (with answers) to work well, the subject field must be something useful and related to the problem!

In addition, current forum users who are kind enough to answer questions should be able to understand the essence of your query at first glance.

So, as a benefit and courtesy to current and future knowledge seekers, please be careful with your subject text. You might receive a forum infraction if you don't pay attention to this.

Thank you.

The UNIX and Linux Forums

Previous Thread | Next Thread
Test Your Knowledge in Computers #514
Difficulty: Easy
As a general rule, the more a variable is used, the longer the variable name should be.
True or False?

Featured Tech Videos