on 06-12-2007 2:56 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.