cancel
Showing results for 
Search instead for 
Did you mean: 

Sender File Adapter Problem when text document is a single line.

Former Member
0 Kudos

Hi All,

I have posted this question earlier too. But did not get a proper answer.

I am using File adapter to fetch data from a file system.

My input data is: AA123BB45678AA345BB78564.

It is just reading the first segment i.e.AA123 and not reading the remaining.

How can I configure my Sender File adapter to pick this pattern of data? It works fine if I have line break after each record that is if the input is as below.

AA123

BB45678

AA345

BB78564

In the above there is a Line break after each segment. So File adapter picks it fine.

I have also tried using xml.A.endSeparator equals to blank in the module configuration. But it does not work either.

Can anyone throw some light to this?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Can you post the structure for your file..How many fields are there in it..Is it 4 or 2..4 fields would be straight fwd, but if its a 2 field structure, you need to pickup the entire line in a single row and split the data based on logic using XSL or Java mapping..

Former Member
0 Kudos

Hi Sri,

I know 4 would have been easier but I have only 2 fields.

<SRC_MT>

<SRC>

<A>

<A1></A1>

<A2></A2>

</A>

<B>

<B1></B1>

<B2></B2>

</B>

</SRC>

</SRC_MT>

But My question is the length of the line is not going to be fixed. I mean in one file it might be 100 in second it might be 200.

So how should I go about it. Because I have to specify some value for SRC.filedFixedLength

Thanks

Abinash

Former Member
0 Kudos

Abhi

I tried a different approach to send your file data In..

You can get each line in the source structure in separate row as

<?xml version="1.0" encoding="utf-8" ?>

- <ns:SingleRowDT xmlns:ns="http://xxxxx.com/xi/pocs/sriram">

- <Recordset>

- <row>

<rowElt>AA123BB45678AA345BB78564</rowElt>

</row>

- <row>

<rowElt>AA123BB45678AA345BB78564AA123BB45678AA345BB78564</rowElt>

</row>

- <row>

<rowElt>AA123BB45678AA345BB78564AA123BB45678AA345BB78564AA123BB45678AA345BB78564</rowElt>

</row>

</Recordset>

Now you can use a suitable mapping logic to split the individual records into the 2 field structure as expected in the target..

Trying your way would be a limitation on file adapter I think..Let me know if this helps..I can give you the content conversion config for this model..

its simply

RecordSet - Leave it empty

RecordSet Seq - Row, *

Recordsets/msg - *

row.fieldSeparator - 'nl'

row.endSeparator - 'nl'

row.fieldNames - 'rowElt

..So each line will be pulled into a single Row in the source structure and then u can apply a specific mapping to split into 2 fields for your target

Regards

Sriram V.

Regards

Sriram V.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sri,

Thanks for the research and giving a solution. I am going to try this case with JMS Sender adapter . Anyway it is working fine with File adapter. I have given you points for your answer.

Again Thanks for your help.

Former Member
0 Kudos

You are welcome.Your pts helped me cross 1000 thx

Former Member
0 Kudos

Hi Abinash,

Can you tell me how did you apply the mapping logic .

thanks

amit