IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Profile: Julian
About
User Name: Julian
Forum Rank: Newbie
Real Name:
Location UK
Occupation:
Interests:
Gender: None Specified
Statistics
Joined: Thursday, June 11, 2015
Last Visit: Monday, March 8, 2021 2:10:41 PM
Number of Posts: 8
[0.04% of all post / 0.00 posts per day]
Avatar
Last 10 Posts
Topic: Dual input CSV (hdr / det) to flat structure
Posted: Monday, March 8, 2021 2:06:56 PM
wriley wrote:
Julian,

You may want to try this with the Join Component, it may lend itself to this well.

It is covered pretty well in the help file, and for a quick review here is a link to a screen shot to part of the help section about it.

https://www.screencast.com/t/AnMQqK296WM0

No guarantee it is the path forward but worth a look I think.





Apologies - I did omit to say that this must be a C# compiled solution - therefore JOIN cannot be used. I did initially look at that. Thanks.
Topic: Dual input CSV (hdr / det) to flat structure
Posted: Wednesday, February 24, 2021 1:21:32 PM
Hi

I have a fairly standard CSV input scenario - header file, detail file. I just need to combine both into an equally simple flat structure (ultimately outputting to fixed width format).

HEADER
KEY1,KEY2,HDR01,HDR02,HDR03
1001,A000,Hfield1a,Hfield2a,Hfield3a
1001,B000,Hfield1b,Hfield2b,Hfield3b
1002,A000,Hfield1c,Hfield2c,Hfield3c
1003,D000,Hfield1d,Hfield2d,Hfield3d
1003,E000,Hfield1e,Hfield2e,Hfield3e

DETAIL
KEY1,KEY2,DET01,DET02,DET03
1001,A000,Detfield1a1,Detfield2a1,Detfield3a1
1001,A000,Detfield1b2,Detfield2b2,Detfield3b2
1001,A000,Detfield1c3,Detfield2c3,Detfield3c3
1001,B000,Detfield1a4,Detfield2a4,Detfield3a4
1001,B000,Detfield1b5,Detfield2b5,Detfield3b5
1002,A000,Detfield1a6,Detfield2a6,Detfield3a6
1002,B000,Detfield1a7,Detfield2a7,Detfield3a7
1003,D000,Detfield1a8,Detfield2a8,Detfield3a8

COMBINED
KEY1,KEY2,HDR01,HDR02,HDR03,DET01,DET02,DET03
1001,A000,Hfield1a,Hfield2a,Hfield3a,Detfield1a1,Detfield2a1,Detfield3a1
1001,A000,Hfield1a,Hfield2a,Hfield3a,Detfield1b2,Detfield2b2,Detfield3b2
1001,A000,Hfield1a,Hfield2a,Hfield3a,Detfield1c3,Detfield2c3,Detfield3c3
1001,B000,Hfield1b,Hfield2b,Hfield3b,Detfield1a4,Detfield2a4,Detfield3a4
1001,B000,Hfield1b,Hfield2b,Hfield3b,Detfield1b5,Detfield2b5,Detfield3b5
1002,A000,Hfield1c,Hfield2c,Hfield3c,Detfield1a6,Detfield2a6,Detfield3a6
1003,D000,Hfield1d,Hfield2d,Hfield3d,Detfield1a8,Detfield2a8,Detfield3a8

Note the excluded records (header rec 5 & detail rec 7) where there is no match between files.

I have a solution (attached), but was wondering if there is a more efficient / "better" method?

Any comments or suggestions gratefully received, thanks in advance.

Julian
Topic: Parse string field into variable structure
Posted: Tuesday, August 18, 2015 8:53:04 AM
Hi island

Thanks a lot. I managed it with a split too.

I hear today that going forward, I will have 100s of different items to contend with! Potentially 100s of gates to that switch.... :o(
Topic: Parse string field into variable structure
Posted: Monday, August 17, 2015 10:18:13 AM
Hi

Thanks a lot for taking time to consider this.

That's very similar to the solution I have managed... although it's a scenario I was trying to avoid, as we may have quite a number of different orders items, and in reality there are many more fields per item than in the example. It soon becomes unwieldy.

Also, each time we are sent a new type of item, I have to change the design of the mapping, and these are deployed remotely to be used in an automated system, and best left alone once in place!

My other solution was to split it out in Flextext before hand.

I'm so annoyed that I cannot use string (only file) as input or the FLF component when using c#, as parsing the variable becomes easy. Although this still means I have to edit the mapping for new products, it's just easier to define.

any idea why this is?

Julian
Topic: Parse string field into variable structure
Posted: Friday, August 14, 2015 2:03:04 PM
Hi
I've been struggling with an design issue this week and would be grateful of any help or pointers you could offer.

Basically, I have to create a mapping that will accept a variable format FLF, whereby the header fields are common, but the rest are not. I have no influence over the input data.

The scenario is that these are order files (hence the common header fields) with item level fields that, although drawn from a common set, vary depending on the item being ordered.
e.g. some may contain a size, some may not, or colour and so on.

The set of fields is reasonable in number, 20 or so, but there are many variations between item types. So, I am trying to find a solution that is easily maintainable and does not mean too much repeated structure set up for example.

I went down a path whereby I have a common input; all header fields split nicely, and then the remaining information is stored in a single field, to be split out during the mapping (I hoped). However, this is where I have got stuck, because the solution I thought I had will not compile in C# (Text file - simple processing for FLF - "Parse Strings to FLF" option).

I've created a very much simplified structure to illustrate the issue. Less fields. FLF in, Tab delimited out. I have included the mapping, flextexts and sample input data, and required output sample from that data. There's a text doc showing the field structure too.

Again, any help would be very much appreciated.

Julian
Topic: Flatten XML structure with set -> text
Posted: Thursday, June 11, 2015 4:47:57 PM
Thanks for the tip vlad.
Topic: Flatten XML structure with set -> text
Posted: Thursday, June 11, 2015 4:21:21 PM
Vlad! Thanks for replying so quickly.

That solution looks great - something in there that I've not done before. I have applied the logic to my full scenario and it looks as though it works... I did not have an error using my XSD btw.. incidental anyway, as I will of course use the full XSD from my actual live files.

So, I come up with this output from the illustrated MFD...

123456,ABC123,NP22AB001,1,4,$77,Outer door skin,1234567890128,
123456,ABC123,NP22AB001,2,10,$84,Locking assembly,1234567890128,
123456,ABC123,NP09KX002,3,18,$14,Cross member,1234567890128,BLU-SUMMER

Thank you SO MUCH.

Julian
Topic: Flatten XML structure with set -> text
Posted: Thursday, June 11, 2015 2:46:47 PM
Hi. I have an XML structure which I need to "flatten" to text / CSV.

I am struggling over getting a set within that structure to extract into fields in a line, rather than separate lines. This is due to restrictions regarding existing systems.

I am attempting this in Mapforce / Flextext ( I have Altova Missionkit Ent Ed.).

I say I'm struggling, but actually I've not managed anything close yet, and any help in getting me in the right direction would be greatly appreciated.

I have attached a simplified example XML, XSD and the desired output.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.