cancel
Showing results for 
Search instead for 
Did you mean: 

How to ignore last four lines in file

Former Member
0 Kudos

Hey All,

We have a requirement where we have to ignore the last four lines of the text file using file sender communication channel. We are using file content conversion and there is no identifier as such which would identify this four lines separately.

Please reply back to me soon.

Thanks and Regards,

Sandeep Maurya

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Absolutely correct , sreeram said,

Use UDF, write that java code, In that ResultList . add all rows ..except last 4, how is by deducting the length of source list- 4, be carefull before that you have to check the length >=4.

This code should be mapped to root to root.

Regards

Chilla..

Former Member
0 Kudos

Hi to all,

Thanks for your help and suggestion.

prabhu_s2
Active Contributor
0 Kudos

u will not be able ignore last 4 lines alone. if u have some identifiers for those line u can probabaly handle this in mapping

Former Member
0 Kudos

Hi Sandeep,

if the length of the file is fix, you could use a mapping, where the occurance of the target message is set to <file.length - 4.>

Regards Mario

Former Member
0 Kudos

1.you can do that by writing a commondline script if have unix operation system iam not sure if we can do that same by in windows by ingoring the last line of a file.

or

2. wirte a Module Processor code

3. wirte a UDF in mapping and and not map the last four lines but you need to check for every field.

Regards

Sreeram.G.Reddy

Message was edited by:

Sreeram Reddy