cancel
Showing results for 
Search instead for 
Did you mean: 

Ignore fields in File Content Conversion

Former Member
0 Kudos

Hi all,

I need to read first 9 fields in Content conversion from text file and ignore all the others.The problem is I don't know exactly the number of fields(it varies from file to file).

I try to use the following in my content conversion:

item.fieldSeparator = ;

item.fieldNames = "Names of item fields"

item.lastFieldsOptional = NO

ignoreRecordSetName = true

Now it works with files with 9 fields,but doesn't with more than 9...

I tried with item.lastFieldsOptional = YES as well but it didn't help...

Anyone any suggestions?

Thanks in advance

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member187587
Contributor
0 Kudos

Hi dimitry,

If no File comm. channel parameters can fullfill your need

you can allways convert all the fields (if its not too many..)and simply ignore them during message mapping in the IR.

Nimrod

Former Member
0 Kudos

Thanks for your help,

Solved the problem,

The soltion was to add some fictitious fields and configure the adapter like the following:

item.fieldSeparator = ;

item.fieldNames = "real field names,some fictious fields"

item.lastFieldsOptional = YES

ignoreRecordSetName = true

item.endSeparator = 'nl'

Shabarish_Nair
Active Contributor
0 Kudos

The problem is I don't know exactly the number of fields(it varies from file to file).

>>>> then how do you write your FCC ? because the mandatory parameters fieldFixedLengths or fieldSeparator and the fieldNames will expect a defined set of values and not dynamic.maybe you can read the file record row kind and then extract the fields u need.

item.lastFieldsOptional

>>>

this is to ignore only the last field.

<i>xml.lastFieldsOptional=YES|NO

This parameter specifies whether the last fields can be omitted (YES) or not (NO) in a CSV structure. If you do not make a specification, the default value is NO.</i>

former_member192798
Active Contributor
0 Kudos