The UNIX and Linux Forums  

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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How convert PCL or PDF file to text in AIX 10789 AIX 0 05-31-2008 12:07 AM
how to convert script file to text file. shaksing Shell Programming and Scripting 2 08-07-2007 05:03 AM
Convert Header into Column in Text file vsubbu1000 Shell Programming and Scripting 7 08-06-2007 01:09 AM
convert XML file into Text file(fixed length) ram2s2001 Shell Programming and Scripting 0 11-02-2005 10:28 PM
Converting Text File into XML using Unix Shell Scripts Laud12345 Shell Programming and Scripting 10 02-16-2005 10:35 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 11-09-2005
Registered User
 

Join Date: Nov 2005
Posts: 13
Plz Help To convert xml file to text file using bourn shell scripts

If someone out there could help me out with this problem. I would really appreciate it.

I am trying to convert xml into text file(fixed length) using Unix Borne shell scripts.

My xml file:

<root>

<header_rec recordtype="00">
<record_id>00</record_id>
<country_code>AK></country_code>
</header_rec>

<detail_rec recordtype="01">
<record_id_01>01</drecord_id>
<country_code_01>AK</country_code>
</detail_rec>

<detail_rec rectyp_2="10">
<record_id>10</record_id>
<country_code>AK</country_code>
<fax>4567677</fax>
</detail_rec>

<trailer_rec recordtype="99">
<record_id>99</record_id>
</trailer_rec>

</root>





My File Test.txt


00AK112005-08-15 (record type=00)(fixed lengths -->recordid:1-2 -->countrycode:5-7


012005-65AK2005-08-15 (record type=01)
012005-65AK2005-08-15 (record type=01)
012005-65AK2005-08-15 (record type=02)
012005-65AK2005-08-15 (record type=02)

99AK11392005-08-+0000424 (record type=99))




I can't use whitespace as a delimiter.


Thanks you guys very much,
I really appreciate it.
Reply With Quote
Google The UNIX and Linux Forums
Forum Sponsor
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:43 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0