on 04-07-2010 4:28 PM
Dear All,
I have an inbound file to PI.
In the file, there are few lines which are not to be used ... those appear in the top, bottom as well as somewhere in the middle of the file.
I know how to take care of undesired lines from the top, but how to take care of those coming in the middle and the bottom? The number of rows for these undesired extra lines in top, middle and bottom of the file will always be fixed.
Example:-
TOP_LINE1 (Extra line)
TOP_LINE2 (Extra line)
DATA_LINE1
.
.
.
MID_LINE1 (Extra line - HELP required)
MID_LINE2 (Extra line - HELP required)
DATA_LINE1
.
.
.
BOTTOM_LINE1 (Extra line - HELP required)
BOTTOM_LINE2 (Extra line - HELP required)
BOTTOM_LINE3 (Extra line - HELP required)
As I mentioned earlier, the number of rows for these extra lines will always be fixed.
Any suggestions / help will be highly appreciated.
Thanks,
--Abhi
Hi,
>>>The number of rows for these undesired extra lines in top, middle and bottom of the file will always be fixed.
why not create a date type that will inport those additional lines as normal lines
and just remove them in the mapping ?
Regards,
Michal Krawczyk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Michal for your reply.
But my scenario is a little complex. I will explain here.
1. The file is having data for CONSUMERS and PROVIDERS.
2. After the top_line undesired rows, is the section for the CONSUMERS.
3. After the mid_line undesired rows, is the section for the PROVIDERS.
4. In the file CC, if I specify RECORDSET STRUCTURE - CONSUMERS,,PROVIDERS, - it complains for keyfieldname.
What am I supposed to put in keyfieldname? I don't have any ...
A sample of the inbound file:-
,,,,,"Division",,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,
,,,,,,,,Inventory Report,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,
,,,,
,,,,
Consumer Owner : ABC ,,,,
Consumer :,,,,
Name,Contact,ID,Addr1,Addr2
John White,203 111 2222,1234,,
J D Edwards, 732 020 1121,South West Drive,NJ
Number of Consumers : 201,,,,
,,,,
Providers :,,,,
ProviderName,Location,LicenseNumber,Contact
ABC,NJ,1001,1800 000 0001
DEF,NY,1005,1 888 000 0001
,,,,
Number of Providers : 102,,,,
,,,,
,,,,
,,,,
,Summary,,,
,,,,
I just need the data from the bold rows. Rest of the rows should be discarded. I have desinged the structure like this -
<MT>
<rec>
<Consumer><Name> ... </Consumer>
<Provider><ProviderName>...</Provider>
</rec>
</MT>
Hope the requirement is clear. Kindly help.
Thanks a lot,
--Abhi
Hi Abhi,
Develope a module and in that before doing the content conversion remove the unwanted lines from the file.
Another option in the File adapter "Run Operating System Command before Processing" may also help. using this you can remove (by writing script) the unwanted content and then process the file.
But I think the Option of doing it in Message mapping would be good but as you said you dn't have key field for them, you can use some combination like skip the top line inn FCC. After doing that you will left with removing the middle and bottom line.
treat those as normal part of the message and filter them in mapping.
Thanks,
Sunil Singh
What you can do is just pick your file as it is (row by row) into your mapping and then you just do the mapping for desired fields only.
First of all create one simple data type to pick the file as it is..
<MT_SourceFile>
<Records> (0..unbounded)
<Items></Items> (0..1)
</Records>
</MT_SourceFile>
Do your sender FCC as shown below
Recordset Structure Records,*
Records.fieldNames : Items
Records.fieldSeparator: 'nl'
ignoreRecordsetName: true
Regards,
Sarvesh
Abhi,
If you have not developed Adapter module before then it would be bit time consuming for you, The Idea behind using this approach was to eliminate what is not required first and then deal with what is required using FCC in adapter.
I would advice you to use combination approach. Wherin first you eliminate the first row in FCC and then removing of middle and bottom fields can be done in Mapping as other folks have suggested.
Thanks,
Sunil Singh
Thanks everyone for their valuable suggestions.
As Michal suggested, I will try to clean up the payload in the mapping ... full points to him, rest of the folks equally awarded.
I am closing the thread, but might open it again if I get stuck up somewhere
Thanks and I appreciate your kind efforts.
--Abhi
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.