Sponsored Content
Top Forums Shell Programming and Scripting How to arrange xml tags in single row using shell script? Post 302657593 by sene_geet on Monday 18th of June 2012 04:08:40 AM
Old 06-18-2012
How to arrange xml tags in single row using shell script?

I want to put one xml record in one row and so on...
sample two records are here.
Code:
<?xml version="1.0"?>
<Object>
  <Header>
    <XCOMVers>V1.0</XCOMVers>
    <REPORT>XXXXX</REPORT>
    <CODE>002</CODE>
  </Header>
  <IssueCard>
    <Record>
	<L>CAR SYSTEM           -SSSSS  -</L>
      <L>                          CODE:      202</L>
      <L>---</L>
      <L>Message:</L>
      <L>:21:XXXXXXXX</L>
      <L>:103B:/1213-XX736472-567GH0</L>
      <L>---</L>
      <L>Confirm:</L>
    </Record>
  </IssueCard>
</Object>
<?xml version="1.0"?>
<Object>
  <Header>
    <XCOMVers>V1.0</XCOMVers>
    <REPORT>XXXXX</REPORT>
    <CODE>002</CODE>
  </Header>
  <IssueCard>
    <Record>
	<L>CAR SYSTEM           -SSSSS  -</L>
      <L>                          CODE:      202</L>
      <L>---</L>
      <L>Message:</L>
      <L>:21:XXXXXXXX</L>
      <L>:103B:/1213-XX736472-567GH0</L>
      <L>---</L>
      <L>Confirm:</L>
    </Record>
  </IssueCard>
</Object>

I want output as :
Code:
<?xml version="1.0"?><Object>  <Header>    <XCOMVers>V1.0</XCOMVers>    <REPORT>XXXXX</REPORT>    <CODE>002</CODE>  </Header> <IssueCard>    <Record>	<L>CAR SYSTEM           -SSSSS  -</L>      <L>                          CODE:      202</L>      <L>---</L>      <L>Message:</L>      <L>:21:XXXXXXXX</L>      <L>:103B:/1213-XX736472-567GH0</L>      <L>---</L>      <L>Confirm:</L>    </Record>  </IssueCard></Object>
<?xml version="1.0"?><Object>  <Header>    <XCOMVers>V1.0</XCOMVers>    <REPORT>XXXXX</REPORT>    <CODE>002</CODE>  </Header> <IssueCard>    <Record>	<L>CAR SYSTEM           -SSSSS  -</L>      <L>                          CODE:      202</L>      <L>---</L>      <L>Message:</L>      <L>:21:XXXXXXXX</L>      <L>:103B:/1213-XX736472-567GH0</L>      <L>---</L>     <L>Confirm:</L>    </Record>  </IssueCard></Object>

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Arrange values of a column in row

HI, I need to arrange values of a colum in row. e.g. input file : Alpha<>123 AAAA<>6754 Beta<>456 BBBB<>63784 CCC<>783 Gama<>789 Alpha<>555 AAAA<>6754 BBBB<>63784 Beta<>666 CCC<>783 Gama<>888 (9 Replies)
Discussion started by: The_Archer
9 Replies

2. Shell Programming and Scripting

Replacing number between xml tags with ksh shell script

Hallo, im basically a complete noob on shell scripting and im trying to replace or rather add 1 to a number between xml tags. The xml basically has a tag somewhere that looks like this: <tag>12345678901234</tag> Now i want to replace the number between the tags. And i want the file to... (6 Replies)
Discussion started by: Demoric
6 Replies

3. Shell Programming and Scripting

How to arrange xml tags in single row using shell script?

I want to put one xml record in one row and so on... sample two records are here. <?xml version="1.0"?> <Object> <Header> <XCOMVers>V1.0</XCOMVers> <REPORT>XXXXX</REPORT> <CODE>002</CODE> </Header> <IssueCard> <Record> <L>CAR SYSTEM -SSSSS -</L> ... (1 Reply)
Discussion started by: sene_geet
1 Replies

4. Shell Programming and Scripting

Shell script to extract data in repeating tags from xml

Hi, I am new to shell scripting. I need to extract data between repeating tags from an xml file and store the data in an array to process it further. <ns1:root xmlns:ns1="http://example.com/config"> <ns1:interface>in1</ns1:interface> <ns1:operation attribute1="true" attribute2="abd"... (2 Replies)
Discussion started by: sailendra
2 Replies

5. Shell Programming and Scripting

Shell Command to compare two xml lines while ignoring xml tags

I've got two different files and want to compare them. File 1 : HTML Code: <response ticketId="944" type="getQueryResults"><status>COMPLETE</status><description>Query results fetched successfully</description><recordSet totalCount="1" type="sms_records"><record... (1 Reply)
Discussion started by: Shaishav Shah
1 Replies

6. Shell Programming and Scripting

Shell scripting - need to arrange the columns from multiple file into a single file

Hi friends please help me on below, i have 5 files like below file1 is x 10 y 20 z 15 file2 is x 100 z 245 file3 is y 78 z 23 file4 is x 100 (3 Replies)
Discussion started by: siva kumar
3 Replies

7. UNIX for Advanced & Expert Users

Shell Script to read XML tags and the data within that tag

Hi unix Gurus, I am really new to Unix Scripting. Please help me to create a shell script which reads the xml file and from that i need to fetch a particular information. For example <SOURCE BUSINESSNAME ="" DATABASETYPE ="Teradata" DBDNAME ="DWPROD3" DESCRIPTION ="" NAME... (2 Replies)
Discussion started by: SmilePlease
2 Replies

8. Shell Programming and Scripting

Need row number with Xml tags value

Hi, Need help. My source file contain data like: 1 <?xml version="1.0"?> <Status>EGZAAE09</Status><Perform>002</Perform><DATE>2013-05-27</DATE> 1 <?xml version="1.0"?> <Status>ECBAE09</Status><Perform>002</Perform><DATE>2013-05-27</DATE> 2 <?xml version="1.0"?>... (3 Replies)
Discussion started by: sene_geet
3 Replies

9. Shell Programming and Scripting

Getting error while including values in xml tags using shell script

Hi All, Please find the code below where I want to add the variable value in between the XML tags. I am taking one string and my goal is to put them between the xml tags. Ex : in between <name> , <lname> Kindly suggest a correction because while executing this script I am getting and... (8 Replies)
Discussion started by: rajneesh4U
8 Replies

10. Shell Programming and Scripting

Read xml tags and then remove the tag using shell script

<Start> <Header> This is header section </Header> <Body> <Body_start> This is body section <a> <b> <c> <st>111</st> </c> <d> <st>blank</st> </d> </b> </a> </Body_start> <Body_section> This is body section (3 Replies)
Discussion started by: RJG
3 Replies
bup-margin(1)						      General Commands Manual						     bup-margin(1)

NAME
bup-margin - figure out your deduplication safety margin SYNOPSIS
bup margin [options...] DESCRIPTION
bup margin iterates through all objects in your bup repository, calculating the largest number of prefix bits shared between any two entries. This number, n, identifies the longest subset of SHA-1 you could use and still encounter a collision between your object ids. For example, one system that was tested had a collection of 11 million objects (70 GB), and bup margin returned 45. That means a 46-bit hash would be sufficient to avoid all collisions among that set of objects; each object in that repository could be uniquely identified by its first 46 bits. The number of bits needed seems to increase by about 1 or 2 for every doubling of the number of objects. Since SHA-1 hashes have 160 bits, that leaves 115 bits of margin. Of course, because SHA-1 hashes are essentially random, it's theoretically possible to use many more bits with far fewer objects. If you're paranoid about the possibility of SHA-1 collisions, you can monitor your repository by running bup margin occasionally to see if you're getting dangerously close to 160 bits. OPTIONS
--predict Guess the offset into each index file where a particular object will appear, and report the maximum deviation of the correct answer from the guess. This is potentially useful for tuning an interpolation search algorithm. --ignore-midx don't use .midx files, use only .idx files. This is only really useful when used with --predict. EXAMPLE
$ bup margin Reading indexes: 100.00% (1612581/1612581), done. 40 40 matching prefix bits 1.94 bits per doubling 120 bits (61.86 doublings) remaining 4.19338e+18 times larger is possible Everyone on earth could have 625878182 data sets like yours, all in one repository, and we would expect 1 object collision. $ bup margin --predict PackIdxList: using 1 index. Reading indexes: 100.00% (1612581/1612581), done. 915 of 1612581 (0.057%) SEE ALSO
bup-midx(1), bup-save(1) BUP
Part of the bup(1) suite. AUTHORS
Avery Pennarun <apenwarr@gmail.com>. Bup unknown- bup-margin(1)
All times are GMT -4. The time now is 09:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy