Hi. I know there must be many ways to skin this cat, but I've invested a little time in xflat and I was wondering if someone has the experience to point out what I'm doing wrong? if someone else knows a better/simpler way to convert the data from flat file to xml I'd appreciate a suggestion also. thanks Jeff My flat file data format consists of records that are pipe delimited and all start with a 2 digit code, here is what 2 files might look like: file1 05|vendor1code|vendor1desc|vendor1code2 05|vendor2code|vendor2desc| 05|vendor3code|vendor3desc|vendor3code2 05|vendor4code|vendor4desc 05|vendor5code|vendor5desc|vendor5code2 10|AA000222|NULLSERVER|D:
|\otherdir\information\AA000222\ 22|part9100|HANDLE|XX00|internalnum3|SMALL HANDLE|0 22|part44|GINORMOUS LEG|AA00|||0 file2 05|vendor1code|vendor1desc|vendor1code2 05|vendor6code|vendor6desc| 05|vendor9code|vendor9desc|vendor9code2 10|XY000034|NULLSERVER|C:
|\mydir\information\XY000034\ 22|part0100|ROTOR|XX00|internalnum12|big ROTOR|1 22|part100-7|BIG FRAME|XX00|||0 The first part of my 'real' data file is like this: 05|CH07|CHICAGO RAWHIDE| 05|XD00|XOULD| 05|XP00|XOULDS SUMPS| 10|XY000034|NULLSERVER|C<code>:
</code>|\mydir\information\XY000034\ 22|part0100|ROTOR|XX00|internalnum12|big ROTOR|1 22|part100-7|BIG FRAME|XX00|||0 and my flat xfl file (the schema for xflat input) is like this: <?xml version='1.0'?> <XFlat Name="navigator_mld_schema" Description="Schema for mld flat file"> <SequenceDef Name="manuals" Description="Manual MLD flat file"> <ChoiceDef Name="import_record" Description="Import Data Of One Record Type" MinOccur="0" MaxOccur="11" MapToXml="No" > <RecordDef Name="oem_05" FieldSep="|" RecSep="\N"> <FieldDef Name="order_code" DataType="Integer" ValidValue="05" MapToXml="No" NullAllowed="No"/> <FieldDef Name="vendor" MapToXml="No"/> <FieldDef Name="description" MapToXml="No"/> </RecordDef> <RecordDef Name="location_10" FieldSep="|" RecSep="\N"> <FieldDef Name="order_code" DataType="Integer" ValidValue="10" MapToXml="No" NullAllowed="No"/> <FieldDef Name="manual" MapToXml="No"/> <FieldDef Name="server" MapToXml="No"/> <FieldDef Name="drive" MapToXml="No"/> <FieldDef Name="path" MapToXml="No"/> </RecordDef> <RecordDef Name="mfgrpart_item_22" FieldSep="|" RecSep="\N"> <
jeffkish
Posts
-
xflat usage -
Why would you read a book !This almost sounds like a personal preference. Books get dated quickly, but hopefully the publishing process means the accuracy has been through some vetting procedure, ensuring a level of accuracy. I like books because they let me curl up somewhere and get away from distractions.. my computer is a built in distraction for some types of research.. I mean I see a link and go somewhere and see another that looks relevant... The next thing I know I have ten tabs up and haven't really focused on any of them yet. The book has hopefully a good author who has taken lots of care to organize the thoughts and material because they want to get paid and for that the book must sell and be useful. So I'll study it carefully and note the references and reasoning and logic. I don't want to pay 50$ for a book on xemacs which I use rarely, but it sure is useful when I do use it. If I can't find my personal reference, I'll google and find out quickly how to switch marks or something on the web.. much easier than finding it in a book. The web is ok or good for some folks or topics or types of research, but for me books almost always have their place. Jeff p.s. thanks to all the altruistic people and/or geeks that put their hard earned knowledge on the web.