cancel
Showing results for 
Search instead for 
Did you mean: 

FCC: Eliminate first line(Header) and last line(Footer)

Former Member
0 Kudos

Hi Experts,

Is there any way to eliminate first line and last line of an incoming file?

Regards,

Vishal

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

What about picking up the whole file and then ingnore the undesired fields to map at target side??

--Sarvesh

Former Member
0 Kudos

Yes.. Initially I tried both the solutions. But it's throwing the following error in Comm channel:

Conversion of file content to XML failed at position 0: java.lang.Exception: ERROR consistency check in recordset structure validation

Former Member
0 Kudos

I think this is a problem of hierarcy. Have you maintained the your structure like this..

MT_TEST
Recordset
field1
field2
.
.
.
Recordset
MT_TEST

infact a good example is given in the blog which Abhishek has provided you, so follow that and do FCC accordingly. And then in mapping you map your desired fields to target.

Also make sure you have created your source struce as per your incoming file.

--Sarvesh

Edited by: Sarvesh Singh on Sep 1, 2009 7:56 PM

Former Member
0 Kudos

I have only one field in Header and one in footer. So, I didn't give Header.fieldSeparator or Footer.fieldSeparator. But it's throwing error for the same. What fieldSeparator should I use in such cases?

Thanks,

Vishal

Former Member
0 Kudos

One more thing is, there's no key field value for 'Body'. And the 'Body' occurence is unbounded.

Former Member
0 Kudos

fieldSeparator / fieldFixedLengths is a mandatory parameter for content conversion

in your case try with newline as endSeparator

first line in file can be eliminated using Document Offset = 1

For footer, you need to handle in mapping

Former Member
0 Kudos

try after adding this

Head.lastFieldsOptional = YES

Footer.lastFieldsOptional = YES

and even thoug fieldSeparator is not coming in your header & footer but you still declare the fieldSeparator for header and footer with same separator as in body.

Former Member
0 Kudos

Hi,

i Have a input file like

Header..........................

01abc ufbcn.......................

68hdjkd dcdc.................

34djfvdjvndfjvn..............

...

....

....

...

...

...

...

Footer..........

and my Data type is

<Header/> 1..1

<value/> 1..1

<Body/> 1...unbound

<Name>

<value>

<Footer> 1..1

<value>

The first line in input file starting with Header should go value under Header.

The last line should go to footer

Rest all lines should go to body.

i tried using keyfieldvalue ,but there is no similarities in the values that are coming in body.

please suggest me how this can be achieved.

Former Member
0 Kudos

You should recreate your data type based on example as given in this blog and then ignore the header and footer in your mapping.. probabily you may have to change the udf a little bit based on your structure..

/people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns

--Sarvesh

former_member200962
Active Contributor
0 Kudos

Did you try using Document Offset property of the FCC to ignore first line

Have Document Offset = 1

Regards,

Abhishek.

Former Member
0 Kudos

Yes I tried that. The requirement is to convert the following file to an xml structure:

MGR:ABC:HDR........................>Start of header

Name1......Value1

Name2......Value2

Name3......Value3

.

.

.

Footer

to the following structure

<DataType>

.........Record(1..unbounded)

...............Name

...............Value

How is it possible to acheive it using fcc?

Regards,

Vishal

former_member200962
Active Contributor
0 Kudos

Since it is Sender FCC.....you have the liberty of changing the Data type (if allowed).....then you can apply the concept as shown in this blog:

/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem

Blog almost similar to your requirement....

Then in mapping do not use the Header and Footer sections.....map other nodes (Record)...hopefully should serve the same purpose.

Regards,

Abhishek.