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
Zemer MargolinSubject: How to convert lines with no identification
Author: Zemer Margolin
Date: 06 Jan 2010 06:09 AM
Hello,
I need to convert a txt file which has the following structure:
header line with a specific ID at position 0
transaction lines with no id
trailer line with a specific ID at position 0

this block repeats itself numerous times in the file.
each block contains transactions of one type only.
transactions type within a block is specified in one of the block header fields.
All lines are tab delimited.
how can I convert such file using Stylus?
thanks
Zemer

Postnext
Tony LavinioSubject: How to convert lines with no identification
Author: Tony Lavinio
Date: 06 Jan 2010 09:17 AM
If you create three patterns, two with regular expression matching
rules and one without, the one without will always be used last.

So the header could match, the trailer could match, and everything
else would use the pattern with no regexp.

Postnext
Zemer MargolinSubject: How to convert lines with no identification
Author: Zemer Margolin
Date: 06 Jan 2010 10:14 AM
Thanks.
the problem is, that each transaction type can have different number of fields with different length.
would Stylus be able to "split" each transaction to fields just by using the fact that it's tab delimited?

Postnext
Tony LavinioSubject: How to convert lines with no identification
Author: Tony Lavinio
Date: 06 Jan 2010 05:18 PM
Each different regular expression row can have its own field layout, so yes.

Postnext
Zemer MargolinSubject: How to convert lines with no identification
Author: Zemer Margolin
Date: 07 Jan 2010 01:39 AM
Thanks.
the problem is, that each transaction type can have different number of fields with different length.
would Stylus be able to "split" each transaction to fields just by using the fact that it's tab delimited?

Posttop
Tony LavinioSubject: How to convert lines with no identification
Author: Tony Lavinio
Date: 09 Jan 2010 08:31 PM
If I understand your question, then the answer is "yes".

 
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.