convert XML file into Text file(fixed length)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting convert XML file into Text file(fixed length)
# 1  
Old 11-03-2005
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>
<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

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert variable length record to fixed length

Hi Team, I have an issue to split the file which is having special chracter(German Char) using awk command. I have a different length records in a file. I am separating the files based on the length using awk command. The command is working fine if the record is not having any... (7 Replies)
Discussion started by: Anthuvan
7 Replies

2. Shell Programming and Scripting

Extracting fixed length number from a text file

Hi, I have a text file with sample records as CASE ID: 20170218881083 Original presentment record for ARN not found for Re-presentment I want to extract the 23 digit number from this file. I thought of using grep but initially couldn't extract the required number. However, after... (16 Replies)
Discussion started by: dsid
16 Replies

3. UNIX for Dummies Questions & Answers

convert # delimited text file to fixed width

Hello gurus, I have a file containing 5 columns delimited by '#' as shown in the example below: HRP1000-PLVAR#HRP1000-OTYPE#HRP1000-OBJID#HRP1000-BEGDA#HRP1000-ENDDA# 99991231#AU7129#000000000#1 PROCTER & GAMBLE# 99991231#TT4283#1000013883#21111 LAUNDRY# 99991231#TT4283#1000013884#21121 DISH... (3 Replies)
Discussion started by: chumsky
3 Replies

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

5. Shell Programming and Scripting

fixed length text file padding issues in AIX

Hi, I have a fixed length text file that needs to be cut into individual files in aix and facing padding issues. If I have multiple blank spaces in the file it is just making it one while cutting the files.. Eg:- $ - blank space filename:file.txt ... (2 Replies)
Discussion started by: techmoris
2 Replies

6. UNIX for Dummies Questions & Answers

Convert a tab delimited/variable length file to fixed length file

Hi, all. I need to convert a file tab delimited/variable length file in AIX to a fixed lenght file delimited by spaces. This is the input file: 10200002<tab>US$ COM<tab>16/12/2008<tab>2,3775<tab>2,3783 19300978<tab>EURO<tab>16/12/2008<tab>3,28523<tab>3,28657 And this is the expected... (2 Replies)
Discussion started by: Everton_Silveir
2 Replies

7. Shell Programming and Scripting

convert fixed length file to CSV

Newbie Looking for a script to convert my input file to delimited text file. Not familier with AWK or shell programing. Below is sample record in my input file and the expected output format. My OS is HPUX 11.23. Thanks in advance for your assistance. tbtbs input file:... (12 Replies)
Discussion started by: tbtbs
12 Replies

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

9. Shell Programming and Scripting

how to convert Fixed length file to delimited file.

I have below fixed lenth file . I have to convert this to delimitted file. File1.txtE116005/29/19930E001E000 E12201/23/19940E001E003 E10406/4/19940E001E003 I want to convert this to : E116,0,05/29/1993,0,E001,E000 E122,0,1/23/1994,0,E001,E003 E104,0,6/4/1994,0,E001,E003 I have a... (7 Replies)
Discussion started by: satyam_sat
7 Replies

10. Shell Programming and Scripting

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>... (0 Replies)
Discussion started by: ram2s2001
0 Replies
Login or Register to Ask a Question
DOLFIN-CONVERT(1)					      General Commands Manual						 DOLFIN-CONVERT(1)

NAME
dolfin-convert - Convert to DOLFIN XML format SYNOPSIS
dolfin-convert [OPTIONS] ... input.x output.y OPTIONS
-h, --help Display help text and exit. -i format, --input format Specify input format. -o format, --output format Specify output format. Supported formats: xml - DOLFIN XML mesh format (current) xml-old - DOLFIN XML mesh format (DOLFIN 0.6.2 and earlier) mesh - Medit, generated by tetgen with option -g gmsh - Gmsh, version 2.0 file format metis - Metis graph file format scotch - Scotch graph file format diffpack - Diffpack tetrahedral grid format abaqus - Abaqus tetrahedral grid format ExodusII - Sandia Format (requires ncdump utility from NetCDF) NetCDF - NetCDF format (requires ncdump utility from NetCDF) StarCD - StarCD terahedral grid format If --input or --output are not specified, the format will be deduced from the suffix: .xml - xml .mesh - mesh .gmsh - gmsh .msh - gmsh .gra - metis .grf - scotch .grid - diffpack .inp - abaqus .e - ExodusII .exo - ExodusII .ncdf - NetCDF .vrt - StarCD .cell - StarCD BUGS
Send comments, questions, bug reports etc. to dolfin@lists.launchpad.net. AUTHOR
dolfin-convert was originally written by Anders Logg <logg@simula.no>. Several others have contributed to add support for different mesh formats. This manual page was written by Johannes Ring <johannr@simula.no>. DOLFIN-CONVERT(1)