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

$ cat Rule.txt
<Rule field="PossDupFlag" value="Y" >
      <Rule expression="SendingTime  - OrigSendingTime  > 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 ,

<Rule field="PossDupFlag" value="Y" ><Rule expression="SendingTime  - OrigSendingTime  > 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.

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