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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
- Stylus Studio Technical Forum (14621)
-> - Stylus Studio - Registrar en o... (1)
-> + Stylus Studio - Registrar en o... (2)
-> + Can a pipeline send a file by ... (2)
-> + After Updateing WIN10 to WIN11... (12)
-> + Where do I add the custom java... (3)
-> + Where is the Diagram tab? (5)
-> + Applying XSLT to Word DOCX/XML (2)
-> - CSV conversion via ConvertToXM... (1)
-> + Text symbols in SS not same as... (4)
-> + Exposing xquery as webservice ... (6)
-> + Syntax Identifier (2)
-> + Saving a Converted XML as an X... (5)
-> + Output document cannot be pars... (4)
-> - Archiving output from conversi... (1)
-> + EDIFACT guideline from Stylus ... (3)
-> + CSV file putting all the data ... (5)
-> + Can't install Home version 64b... (5)
-> + presale - Can I covers this sc... (5)
-> + Problem with UNB (5)
-> + Splitting EDIFACT files pipeli... (4)
-- [1-20] [21-40] [41-60] Next
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
+ XQuery Help and Discussion (2016)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
david seidenfrauSubject: How to Mattern Patch in the middle of a row
Author: david seidenfrau
Date: 11 Nov 2005 04:52 PM
I have an Old Cobol based file with Many row types inside of it. I am trying to use the Convert to XML but I can't figure out how to pattern match on a character sequence in the middle of the ROW. Is this supported?

I had thought of creating a region for each ROW type, but the ROWS repeat for each entity. Also, each row has completely different columns. The only thing in common is the record length.

Postnext
Tony LavinioSubject: How to Mattern Patch in the middle of a row
Author: Tony Lavinio
Date: 14 Nov 2005 09:54 AM
You could try something like ^?{20}XYZ if you know that
XYZ start at position 20 in the record. If you can post
a *small* sample of the data in question, we'd be happy
to help.
You are right not to use regions.

Postnext
david seidenfrauSubject: How to Mattern Patch in the middle of a row
Author: david seidenfrau
Date: 14 Nov 2005 10:44 AM
Sure. Here's a small sample: AO, D0, D1, D3 is a record identified and for each entity in this file (the key is A2782P11) they will repeat. They don't always repeat for the entity only if there is data that pertains to that record type for the entity collected.

A2782P111 CA0 0120050810A2782P111 C 00000000 G
A2782P111 CD0 01IMMOEAST IMMOBILIEN AG SHS
A2782P111 CD1 01OUTFC 000000 0 000000000000 00YNY AT NA N
A2782P111 CD2 010000000000000000000000 00000000000000 F
A2782P111 CD3 01 00000000000000 000000000
A2782P111 CE0 01 0000000000000000000 00000000000000
A2782P111 CE1 0100000000 00000000 00000000 00000000
A2782P111 CR1 01 00000000 00000000 00000000
A2782P111 CT2 01 9920050810AIMOIF
A2782P111 CX0 01A2782P111 018977133 7733967AT0000642806

Postnext
Tony LavinioSubject: How to Mattern Patch in the middle of a row
Author: Tony Lavinio
Date: 15 Nov 2005 09:07 AM
Using a pattern of ^.{11}A0 will select the A0 rows; you can do
something similar for each one.
After that, it's a standard grouping problem.
So...
After you get your data converted into XML, then write an XSLT
or XQuery program to group together the data for each entity
element.
See http://www.stylusstudio.com/SSDN/default.asp?action=9&read=4216&fid=48
for an example of how to do this.

Postnext
david seidenfrauSubject: How to Mattern Patch in the middle of a row
Author: david seidenfrau
Date: 15 Nov 2005 09:59 AM
OK - I will do that. My next issue though is bringing it in is when I use line oriented I can't really define the fields correctly. It's a fixed width file, but each line has different rows - fixed width doesn't work, and line oriented also doesn't seem to work. Try bringing it in yourself - How do I do that?

Postnext
Tony LavinioSubject: How to Mattern Patch in the middle of a row
Author: Tony Lavinio
Date: 16 Nov 2005 09:23 AM
If each row has a fixed-width, but the fields within those rows
vary in width based on some pattern, you need Stylus Studio 2006
which was recently released.

Also, fixed-width fields within variable-width records are also
now supported in 2006.

Postnext
david seidenfrauSubject: How to Mattern Patch in the middle of a row
Author: david seidenfrau
Date: 16 Nov 2005 09:26 AM
I am using version 6 release 3 build 377 professional edition eval to see if this will work for me. Is that the right version?

Postnext
david seidenfrauSubject: How to Mattern Patch in the middle of a row
Author: david seidenfrau
Date: 16 Nov 2005 09:52 AM
I am using version 6 release 3 build 377 professional edition eval to see if this will work for me. Is that the right version?

Postnext
david seidenfrauSubject: How to Mattern Patch in the middle of a row
Author: david seidenfrau
Date: 16 Nov 2005 09:54 AM
I am using version 6 release 3 build 377 professional edition eval to see if this will work for me. Is that the right version?

Posttop
(Deleted User) Subject: How to Mattern Patch in the middle of a row
Author: (Deleted User)
Date: 16 Nov 2005 09:21 PM
David, Here is a sample of one way to solve your problem using version 6 release 3 (377).
It should be somewhat easier with the lastest and greatest Stylus Studio 2006 !
I looked at your data file and guessed where the fields start and stop. Of course, I didnt guess right, so this is just a sample.
Attached is rawdata.txt - a copy of the sample you sent with rows padded to 59 characters (just an example :).
CA0.xslt will create an .xml output file with all the CA0 data rows.
CD0.xslt will create an .xml output file with all the CD0 data rows.
To setup this example:
1) Find the Adapter directory where Stylus Studio is installed, probably
C:\Program Files\Stylus Studio 6 XML Professional Edition\Adapter
2) put files CA0.conv and CD0.conv in that directory.
3) put rawdata.txt CA0.xslt and CD0.xslt anywhere you want.
4) Start Stylus.
5) Click on File-Open.
6) Click on the XML Converters icon.
7) Double click on CA0.conv to open it.
8) You should see a properties window, insert theURL to rawdata.txt in the first property: "input file". Use the full URL: file:///c:/...
9) Repeat steps 5,6,7,8 for CD0.conv
10) Now, open CA0.xslt and CD0.xslt and run them.

This is just one possible way to solve the problem.
- clyde


Documentrawdata.txt


DocumentCA0.xslt


DocumentCD0.xslt


DocumentCA0.conv


DocumentCD0.conv

   
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.