mapping logic

Hi Everyone,

I have to convert a Flatfile to xml format.The number of records in flatfile are around 100 for single individual information.The flatfile contains multiple individual information.The records are not mandatory.I need sugesstion over following points
1.shall i use loop step for the for each documentlist for each record?
( since no of records are high is it ok to have that many loop steps to extract and map data)
2.another problem is if a record is missing(suppose 13th record) in a particular individual information,the data is mapped by taking next individual information(i.e 13th record)?

Thanks In advance!

  1. Yes. You need in two loops: external one is after tokenize the flatfile by carriage return as delimiter (or keep “delim” parameter is empty), and internal loop is after tokenize of each record by its delimiter (comma, tab, etc.). Of course, if your mapping algorithm is consistent mapping of the items into XML record. Else use appropriate mapping steps instead of internal loop.

  2. “tokenize” service ignores empty items in the string. For example, if your flatfile will be like this:
    ===
    123,456,789

qwe,rty,uio

Then following StringList will be after tokenizing:

[0] 123,456,789
[1] qwe,rty,uio

But if flatfile will be like this:

123,456,789
,
qwe,rty,uio

Then following StringList will be after tokenizing:

[0] 123,456,789
[1] ,
[2] qwe,rty,uio

So, empty StringList2 (but not null) will be after tokenizing of item [1]. Then you can use “pub.list:sizeOfList” service to determine size of the StringList2. If it equals 0, then don’t call internal loop ( don’t map data into XML record)