Creating Flatfile scemas for repeating fileds in one record

Hi All ,

I got one requirement which is having repeating fileds in one record with tab delimeter with no record identifier.

eg:

field1 field2 field3 item1 item2 item3 item1 item2 item3 item1 item2 item3

where fileld1,field2 ,field3 are header level and item1,item2,item3 are detail level items which are repeating .

I creating a dictionary for header level fileds as record as recordWithNOID and using the same in schema .

Here my question how to add detail level items to this schema which I am failing to do .

Please advice me , help is realy appeacited.

Thanks ,

Raj

hey raj if you cna give me some more info, i think i can be of some help.
wht are you gonna do wid the FF ie map to DB or convert it to diff format something like that n if possible can you paste some real data( couple of rows from ur original FF).

Thanks
Venu

Hi All,

I am new to webMethods.Please help me in resolving this issue.

I am also facing the same problem.(repeating fields in one record with comma as delimiter and carriage return as record delimiter)

For Eg:

Field1,Field2,Field3,Field4,Field5,Field4,Field5…

Here Field4 and Field5 are repeating.

I have created a dictionary for first 3 fileds as record as recordWithNOID.

Now my question is how to add the remaining fields which are repeating.(whether to create a new record or I have to add the fields to the same record)

Please advice me.

Thanks,
Gokila

I would say create record with recordWithNoID and add all the fields in there (even the repeating fields…You may have to use diff name for repeating field if same field names are not allowed under a record…not sure) .Because even though they are repeating they are sent as a separate fields by the source system
So downstream if the requirement was to insert just one repeating field into DB then code such that you drop the other field

thanks
Anil

Hi Anil,

Thanks for your reply.
I agree with your point.

If the count(number of times the fields are repeating) is same for all records,then it will work.

But in my case ,it will differ.
For Eg:

Field1,Field2,Field3,Field4,Field5,Field4,Field5
Field1,Field2,Field3,Field4,Field5,Field4,Field5,Field4,Field5,Field4,Field5
Field1,Field2,Field3,Field4,Field5,Field4,Field5,Field4,Field5

Now how to proceed with this?

Thanks,
Gokila

Hi Gokila,

if u know the maximum number of fields coming in one row then create a flat file dictionary with that many fields (field1,field2,…,fieldn) and make those fields optional.

Then loop over the recordWithNoID and just map to target format.
Let me know if it works else we can find some solution …

Regards,

Karan…

I agree with Karan’s point .If max rows are known then define them as optional or else i don’t think this(variable file format) can be done using flatfile schemas
Instead you may have to read each record and tokenize based on the delimiter(comma in your case) and Loop over the string list(tokenize output ) and map each field accordingly

Lets us know if u find anyother better solution

thanks
Anil