XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Alan LapworthSubject: help converting a text file to xml
Author: Alan Lapworth
Date: 21 Sep 2007 06:08 AM
Hi all,

I'm trying to convert a variable length file into XML. The problem is that each line consists of 3 different types of record:

1. record details.
2. header record.
3. detail record.

Just to confirm, all three of the above appear on the same line.

The record details are fixed width while the other two parts contain variable length data.

I can use regions ok if the file we receive is a single line but not when multiple lines exist (line 2+ of the file just appears as data in region 3). The detail record is terminated with the code "** **" but at the moment I cannot confirm if we will receive the data with a CRLF after each group of 3 records.

Any help with this would be much appreciated.

Al

Postnext
Tony LavinioSubject: help converting a text file to xml
Author: Tony Lavinio
Date: 21 Sep 2007 10:03 AM
Instead of using regions, you want to use the pattern-matching
facility. This selects rows based on 'regular expressions', and
each different pattern-matched row can have a different layout.

Postnext
Alan LapworthSubject: help converting a text file to xml
Author: Alan Lapworth
Date: 21 Sep 2007 10:14 AM
Thanks Tony, but each row will have the same layout of records in each line.

This would be a line in a file:

160544A2070919160544070919160544070919070919160544 D#A<$G1215 @+!7<"!7** #4(!!1(&$1215(%$AAAA(#&000000(R$1313(6"10%1*9999999999%2%90046%3%75116%;$0750<8!L(/,999999999999>*$0456** **

the record header is:
160544A2070919160544070919160544070919070919160544 D

record type is:
#A<$G1215 @+!7<"!7**

record details is:

#4(!!1(&$1215(%$AAAA(#&000000(R$1313(6"10%1*9999999999%2%90046%3%75116%;$0750<8!L(/,999999999999>*$0456** **

this would be repeated on each line of the file.

After each record type has been broken (header, record type, detail) i would then need to break the records down into fields.

Al

Postnext
Tony LavinioSubject: help converting a text file to xml
Author: Tony Lavinio
Date: 28 Sep 2007 08:10 AM
Could you send a sample of the input file to stylus-field-report (at)
progress.com, and a rough mockup of what the equivalent XML should be?
Then we'll take a closer look.

Posttop
Alan LapworthSubject: help converting a text file to xml
Author: Alan Lapworth
Date: 28 Sep 2007 09:45 AM
Thanks for the offer Tony, but as it stands at the moment the sender of the data is going to convert it to XML for us (this may change as the project moves forward).

Al

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.