The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
transpose file new_ds_man Shell Programming and Scripting 3 07-09-2009 12:45 AM
Transpose Rows iamwha1am Shell Programming and Scripting 4 03-18-2009 10:39 PM
How do I transpose a column of results to a row m223464 Shell Programming and Scripting 6 05-06-2008 07:33 AM
Row to column transpose videsh77 Shell Programming and Scripting 10 06-16-2007 12:54 PM
transpose command su_in99 UNIX for Dummies Questions & Answers 3 05-16-2007 05:10 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-21-2009
new_ds_man new_ds_man is offline
Registered User
  
 

Join Date: Jul 2009
Posts: 6
Transpose using awk

I have a requirement to transpose the below xml which is in a text file on unix:

Code:
<?xml version="1.0" ?>
<REQUEST>
<ID>XXX</ID>
<TIMESTAMP>20090720062610</TIMESTAMP>
<FLAG>Y</FLAG>
<TO_FLAG>Y</TO_FLAG>
</REQUEST>
to

Code:
<?xml version="1.0" ?><REQUEST><ID>XXX</ID><TIMESTAMP>20090720062610</TIMESTAMP><FLAG>Y</FLAG><TO_FLAG>Y</TO_FLAG></REQUEST>
the current awk command that i am using provides the output truncating all the spaces as below, the spaces in the tag
Code:
<?xml version="1.0" ?>
are removed:

Code:
<?xmlversion="1.0"?><REQUEST><ID>XXX</ID><TIMESTAMP>20090720062610</TIMESTAMP><FLAG>Y</FLAG><TO_FLAG>Y</TO_FLAG></REQUEST>
the awk command i am using:
Code:
awk '$1=$1' RS='' OFS='' test_trans.txt > SEQS_TRANS_test.txt

Help appreciated , Thanks in Advance.

Last edited by vgersh99; 07-21-2009 at 10:12 AM.. Reason: code tags, PLEASE!
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:52 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0