on 06-01-2009 11:40 AM
Hi,
How can we remove the last line from the file using content conversion?
The last line should not be read from the input file.
Like for the first line we can use Document Offset .......similarly do we have any option for the last line?
>>Like for the first line we can use Document Offset .......similarly do we have any option for the last line?
Nope. There is no standard feature that will help you here. You need a custom developed adapter module or handle it in the mapping.
Regards
Jai
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
THe existing mapping you have is a graphical mapping or a Java mapping? If it is a Java mapping then the solution is very simple, just write a few lines of code to remove the last occurrence of every node in the input XML. If you have a graphical mapping, then you need queue based processing of each field and then a small udf to remove the last element of it. This approach might be very tedious if your mapping is already complex.
You can go for a Java mapping where you just remove the last nodes and then trigger this actual graphical mapping. This might be easier.
Thanx Jai......I need to do it in graphical mapping itself.
In other case.....Do you have any idea about this case :-
I have specified the key field name but i cant use any key field value as that is not same in all the rows......so can i read all the rows and also i don't have to specify the keyfield value. Key field is needed as i have specified Emp,,Sub, and under Emp all the rows dont have the same key field value and the values can be changed from file to file so i dont need to specify the key field value....
Plz help me as I require this solution urgently
>>Thanx Jai......I need to do it in graphical mapping itself.
That is why I suggested to have the graphical mapping as it is. But before invoking this graphical mpping invoke a small java mapping that will remove the extra line for you. You can have multiple mappings in the same scenario.
>>I have specified the key field name but i cant use any key field value as that is not same in all the rows......so can i read all the rows and also i don't have to specify the keyfield value. Key field is needed as i have specified Emp,,Sub, and under Emp all the rows dont have the same key field value and the values can be changed from file to file so i dont need to specify the key field value....
Can you give an example of your input file with some dummy values? I find it very difficult to understand with this description.
date Empno Empname
19.03.2009 12345 Neel
20.03.2009 34566 Neelkanth
EmpDes Japan 100
The file is like this first row i have removed using document offset.......from 2nd row till nth row the structure is as shown above and the last row has no. of fields 1 less than all other rows and also its root node is different like shown above its rootnode is EmpDes..........How to use File content conversion for this?
>
> date Empno Empname
> 19.03.2009 12345 Neel
> 20.03.2009 34566 Neelkanth
> EmpDes Japan 100
>
>
> The file is like this first row i have removed using document offset.......from 2nd row till nth row the structure is as shown above and the last row has no. of fields 1 less than all other rows and also its root node is different like shown above its rootnode is EmpDes..........How to use File content conversion for this?
do you want to avoid the last line i.e
EmpDes Japan 100
?
in that case the 3 options are
1. use a adapter module and remove the last line - this is the ideal option
2. use a OS script - will work but only if you are using the NFS option in the file adapter instead of FTP
3. read that also using content conversion (treat it as a trailer) and ignore it during the mapping
>
> I have not mapped them but like this I m getting error in SXMB_MONI and the request mapping is not getting generated.
>
> the whole file is getting read
> Actually EmpDes Japan 100 are coming under the nodes of date Empno and Empname........so the request structure is not getting generated.
If you say that empdes, japan& 100 are coming under date, empno and empname then it means that you have not identified the trailer properly in FCC.
What Shabarish mentioned should work.
Hi,
You can simply do this by using Operating system Command parameter while configuring Sender Communication channel (FTP Adapter).
For reference just have a look at ...
XI/PI: Command line sample functions
/people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions
Regards,
Chandra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.