cancel
Showing results for 
Search instead for 
Did you mean: 

Adding CRLF at the end of a flat-file in a File to File pass-through scenario without mapping

0 Kudos

Hi,

My requirement involves two ICO's where :

  1. In the first ICO, I am using a File sender channel to pick all the files having .csv extension from a certain location & merge them into a single file in another location. I am using receiver file channel in "append" mode in a File-to-File pass-through scenario to obtain this.
  2. In the 2nd ICO, I am using File Content Conversion & some mapping.

My problem is with the 1st ICO only & hence I am detailing about it only.

Some .csv files are coming without CRLF at the end of the last record. Hence when it is merged with the next file, the two records are coming in the same line.

OUTPUT FILE :

As a result, the FCC fails in the 2nd ICO.

Now my question is that : Can I add CRLF by default at the end of each file without doing any mapping? Is there any adapter module to handle that?

I tried "SAP XI Sample/ConvertCRLFfromToLF" using the parameters- "LFtoCRLF", "any", but it didn't work, because, I guess ConvertCRLFfromToLF converts LFtoCRLF or viceversa. But when "nothing" is coming at the end of the file, how can it work.

Please help.

Thanks

Samikshan

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

To add to Harish's response -> You would need to use Content Conversion on both your sender and receiver adapters in your pass through scenario to be able to add the CRLF. As the seconds ICO already converts the CSV to XML, this shouldnt be too complicated.


Regards

Bhavesh

0 Kudos

Hi Bhavesh,

Can you please tell me how can I use FCC in the pass-through scenario (1st ICO)?

or

Are you telling me to do the conversion in the 2nd ICO ?

Thanks

Samikshan

bhavesh_kantilal
Active Contributor
0 Kudos

Samikshan,

Instead of your scenario being a pass through scenario, what I am suggesting is you configure content conversion in your sender and receiver file adapter.

Sending File adapter converts CSV to XML and Receiver File Adapter XML to CSV.

When the file is being written in the receiver file adapter,,

- Make sure the CRLF is added as per link shared by Harish

- Use Append mode in the file adapter to append content to the files.

Regards

Bhavesh

Answers (2)

Answers (2)

0 Kudos

Thank you all for your replies.

But I was wondering if there is any adapter module which can handle this alone? Then, there would be no need of FCC (& an XML structure)

Harish
Active Contributor
0 Kudos

Hi Samikshan,

In  your receiver file adapter update the below setting

- open Integration Directory and edit your receiver CC;

- under the "Processing" tab you must specify "File type = Text";

- you can also specify "File encoding = UTF-8" if you need it, but it's non mandatory;

- under che "Content conversion" tab you must specify a property on each of your record types. The property you must set is endSeparator.

regards,

Harish