cancel
Showing results for 
Search instead for 
Did you mean: 

Can i have file content conversion without key field

Chandra_Hota
Participant
0 Kudos

Hello All

My requirement is, in the input file, i have a single header line, multiple item lines and single footer line.

In the item line, i donot have any key field where the value would be repeated in all the lines.

I have fields like asset id, date, cost centre, model number etc, where none of the values get repeated.

So, it possible to have file content conversion in this scenario with out specifying key field?

If not, how can i go ahead from here using file content conversion?

Many Thanks

Chandra

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

HI Chandra

If you dont have fixed number of fields then without key field you will not be able to read file with structure Header, Items, footer.

You need to have key fields to identify start of Items and footer.

Most of the methods are discussed above

1. Adapter module

2. Read the file as a single string using CDATA and then handle in mapping.

3. Use a script to read to add key in your file.

4. You can also use Java proxy to process this file.

Thanks

Gaurav

Former Member
0 Kudos

You might not need the key field if you have constant no# of records appearing. Do you know how many item lines will be present? If this is dynamic, then i key field is required to distinguish the records.

Chandra_Hota
Participant
0 Kudos

Hi Anand

Number of rows in Item record is dynamic. It is not constant.

Now, if i dont have a key field, how can i proceed from here?

Thanks

Chandra

Former Member
0 Kudos

Hi Chandra,

Without a way to identify each record, I don't think you will be able to continue with the content conversion in the file adapter. The key field is required when you have a * in the RecordSet Structure. You may need to consider other alternatives:

1) File Adapter Module

2) Send flat file into XI (no conversion by the file adapter) and handle the conversion to XML in a java mapping:

3) I know it's not the best approach, but you could also consider using some scripting to add the missing row identifiers before the file adapter processes it. See the "Run Operating System Command Before Processing" options for the file adapter.

-Russ