on 04-02-2015 1:55 AM
Hello, friends!
I work on scenario where I want to put some message data to flat text file for further processing. And want to append data to existing file instead of making new one each time I get new message.
In my receiver file communication channel I use file content conversion to make a flat structure from xml data and use "Append" file construction mode to add new data to existing file.
It works, but... new data is appended to file starting at last position of the last line. And I want it to append data starting at new row.
I tried to use parameters like ".endSeparator" and "beginSeparator" with value "'nl'" but it doesn't work for me.
What else could I do to make it work the way I want?
I see that 'nl' as endSeparator adds new line to file but next portion of data is written right after the last sign and not from new line.
And the second: I try using 'nl' as beginSeparator but it append it in file as 'nl' instead of adding a new line. What am I doing wrong?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Another way for me might be to read flat file consisting of one row at next step but I can't do that too.
Source file then looks like:
AAAAABBBBBCCCC
where each value has the same length and represents a single row of data. But FCC in Sender File Adapter reads only first value (first row).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Evgeniy,
I stand corrected,
The parameter would be ".beginSeparator" and the value should be 'nl' including the single quotation marks.
Thanks,
Alka.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Could you please share the screenshot of your file content conversion parameters
Thanks
Giridhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hareesh Gampa wrote:
>>>I tried to use parameters like ".endSeparator" and "beginSeparator" with value "'nl'" but it doesn't work for me.
if you are sure about it, then add a newline for the last field during the mapping.
Refer to Former Member reply in below thread
File adapter-How to set line break in text file-split record into two lines
What do you mean "add a newline for the last field"? I've tried to add an empty row to my source xml structure but it didn't work either.
>>>What do you mean "add a newline for the last field"? I've tried to add an empty row to my source xml structure but it didn't work either.
If you have gone through the discussion that i shared, Marina had the similar problem.
If below is your target structure, then when you map IDOC_REFINT field, append a newline to it. So that everytime a newline would be added by the mapping itself.
Input XML structure looks like:
<Message>
<IDOC>
<IDOC_REFINT>Value(23 signs)</IDOC_REFINT>
</IDOC>
</Message>
your source field -> UDF -> IDOC_REFINT
UDF : (execution type: single values)
String output= var1 + "\r\n ";
return output;
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.