cancel
Showing results for 
Search instead for 
Did you mean: 

creation of data type

Former Member
0 Kudos

hi all xi developers.

iam new to xi.

so here i got one spec like.

in sender file.

HEADER|22012007|WMD

123565139|220.05

133565127|1230.05

143565511|260.00

153565812|11345.05

122565912|320.05

123565013|21259

125565814|232.05

131565212|200.00

132565145|38.05

134565173|5213.10

136565191|298.05

137565132|228.10

TRAILER|12|40843.55

here i got one doubt like how the reciver file adapter is going to recognize which one will be the header,which will be the body n which will be the footer.

i.e how we can define all these in reciever com channel,sender channel.

so i wanna to change the sender file as.

HEADER|22012007|WMD

BODY|123565139|220.05

BODY|133565127|1230.05

BODY|143565511|260.00

BODY|153565812|11345.05

BODY|122565912|320.05

BODY|123565013|21259

BODY|125565814|232.05

BODY|131565212|200.00

BODY|132565145|38.05

BODY|134565173|5213.10

BODY|136565191|298.05

BODY|137565132|228.10

TRAILER|12|40843.55

and iam creating sender data type as.

header

identifier

docdate

siteid

detailed

identifier

accno

amount

trailer

identifier

totrec

totalamt

and i want to set sender comchannel as under keyfieldname as identifier and headerkeyfield value as HEADER,n similarly bodykeyfieldvalue as BODY n for footer the same thing.and header.field names as identifier,docdate,siteid.header fields as identifier,docdate,siteid.

n similarly for other body n trailer.

but when i set these on design and configuration.

iam getting eror under sender file adapter as footer.fieldfixedlenghts,footer.fieldseparator is missing.

waiting for the superb answer.

bye.

regards.

seeta ram.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Take data type as

Header

ABC

EFG

Body

ABC

EFG

Footer

ABC

EFG

The use File content conversion.

Give Header,1,Body,*,Footer,1 as recordset structure.

U can also go through the blog

for Sender File content Conversion

/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30

/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter

/people/sap.user72/blog/2005/01/06/how-to-process-csv-data-with-xi-file-adapter

/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file

And for reciver

/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion

Regards

Hemant

Give points if find helpful

Former Member
0 Kudos

Hi,

Put

Header as Node and ABC and EFG as elements

Same Body as NODE and ABC and EFG as element

Same Footer as Node and ABC and EFG as element.

Reagrds Hemant

Answers (1)

Answers (1)

ravi_raman2
Active Contributor
0 Kudos

There might be one answer, create a java pgm to parse this input and split it into header, footer and read those independently.

The java pgm should be pretty straight .can use regex,...

//Read input as a string= Str

Pattern p = Pattern.compile("str");

Matcher mH = p.matcher("Header");

Matcher mF = p.matcher("Footer");

if(m.find()){

//write to a file called header.txt and slurp it back

}

that should work

Regards

Ravi