Subject: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.
Subject: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.
Subject: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.
Subject: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).