Plz Help To convert xml file to text file using bourn shell scripts


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Plz Help To convert xml file to text file using bourn shell scripts
# 1  
Old 11-09-2005
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Programming

How to write in other language in text/xml file by reading english text/xml file using C++?

Hello Team, I have 2 files.one contains english text and another contains Japanese. so i have to read english text and replace the text with Japanesh text in third file. Basically, I need a help to write japanese language in text/xml file.I heard wstring does this.Not sure how do i write... (2 Replies)
Discussion started by: SA_Palani
2 Replies

2. Shell Programming and Scripting

Read csv file, convert the data and make one text file in UNIX shell scripting

I have input data looks like this which is a part of a csv file 7,1265,76548,"0102:04" 8,1266,76545,"0112:04" I need to make the output data should look like this and the output data will be part of text file: 7|1265000 |7654899 |A| 8|12660000 |76545999 |B| The logic behind the... (6 Replies)
Discussion started by: RJG
6 Replies

3. Shell Programming and Scripting

Need help to write a shell script to convert text file to excel file.

Hi Everyone, I want your help to write a script which will take text file as input and on the basis of delimiter ":"script will create excel sheet. Example input: IpAdress:InstanceName:Port:ServerName 10.255.255.1:abc:2232:xyz_abc Output should be an excel sheet like below: Column... (8 Replies)
Discussion started by: akabhinav18
8 Replies

4. UNIX for Dummies Questions & Answers

Reading XML file and print the values in the text file using Linux shell script

hi guys, i want help... Reding XML file and print the values into the text file using linux shell script file as per below xml file <sequence> <Filename>aldorzum.doc</Filename> <DivisionCode>US</DivisionCode> <ContentType>Template</ContentType> <ProductCode>VIMZIM</ProductCode> </sequence>... (1 Reply)
Discussion started by: sravanreddy
1 Replies

5. Shell Programming and Scripting

How to convert xml file to text file?

Hi Everyone, I want to convert 1 xml file to text file.... Please help in the xml file i have 4 columns.... Thanks a lot in advance. Nilesh (6 Replies)
Discussion started by: nileshbhawsar
6 Replies

6. Shell Programming and Scripting

Convert XML to Data File in Shell Script

Hi All, I will be getting a huge XML file with a lot of records in it. I need to convert it into multiple data files. SAMPLE XML FILE <ABSProductCatalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <ProductSalesHierachy> - <Portfolios> - <Portfolio productCode="P1"> ... (8 Replies)
Discussion started by: ragha81
8 Replies

7. Shell Programming and Scripting

Convert XML file into TEXT file using PERL seript

Dear Yogesh..."Convert XML file into TEXT file using PERL seript"... can u help me regarding this issue...plz Thanks Rudro (0 Replies)
Discussion started by: Rudro
0 Replies

8. Shell Programming and Scripting

convert XML file into Text file(fixed length)

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> ... (0 Replies)
Discussion started by: ram2s2001
0 Replies

9. Shell Programming and Scripting

Converting Text File into XML using Unix Shell Scripts

Hi everyone, If someone out there could help me out with this problem. I would really appreciate it. I am trying to convert a file into xml format using Unix shell scripts. The file has fields with each field having a certain number of bytes, but the fields are not delimited by anything... (10 Replies)
Discussion started by: Laud12345
10 Replies
Login or Register to Ask a Question
PACEMAKER(8)						  System Administration Utilities					      PACEMAKER(8)

NAME
Pacemaker - Part of the Pacemaker cluster resource manager SYNOPSIS
crm_verify [modifiers] data_source DESCRIPTION
crm_verify - Check a (complete) confiuration for syntax and common conceptual errors. Checks the well-formedness of an XML configuration, its conformance to the configured DTD/schema and for the presence of common misconfigu- rations. It reports two classes of problems, errors and warnings. Errors must be fixed before the cluster will work properly. However, it is left up to the administrator to decide if the warnings should also be fixed. OPTIONS
-?, --help This text -$, --version Version information -V, --verbose Increase debug output Data sources: -L, --live-check Check the configuration used by the running cluster -x, --xml-file=value Check the configuration in the named file -X, --xml-text=value Check the configuration in the supplied string -p, --xml-pipe Check the configuration piped in via stdin Additional Options: -S, --save-xml=value Save the verified XML to the named file. Most useful with -L EXAMPLES
Check the consistency of the configuration in the running cluster: # crm_verify --live-check Check the consistency of the configuration in a given file and produce verbose output: # crm_verify --xml-file file.xml --verbose AUTHOR
Written by Andrew Beekhof REPORTING BUGS
Report bugs to pacemaker@oss.clusterlabs.org Pacemaker 1.1.7 April 2012 PACEMAKER(8)