Welcome Guest! Log in
×

Notice

The forum is in read only mode.
Due to some maintenance operations, stambia.org will be switched to read-only mode during the 13th November. It will be possible to read and download, but impossible to post on the forums or create new accounts. For any question please contact the support team.

Topic-icon Solved Truncate a file before a loop

More
10 Dec 2015 12:49 - 10 Dec 2015 15:21 #1 by Josserand BRINON
Josserand BRINON created the topic: Truncate a file before a loop
Hi,

I would like to know what is the best way to truncate a flat file before integrating data.
I cannot use the "Truncate Target File" from the template, because the mapping is used in a loop.

I have tried to use a "Write a file" with no text in it, before the loop.



It nearly works... The problem is that an empty line is written at the beginning of the file, and data starts on the second line.

Thanks.
Attachments:
Last Edit: 10 Dec 2015 15:21 by Josserand BRINON.
More
10 Dec 2015 14:52 #2 by Cyril Dussud
Cyril Dussud replied the topic: Truncate a file before a loop
Hi,

Have you tried to change the template parameters of your mapping ?
You should have a File Separator parameter to change this behavior:



Try to set it to after.
Attachments:
More
10 Dec 2015 15:20 #3 by Josserand BRINON
Josserand BRINON replied the topic: Truncate a file before a loop
Perfect, it works :)
Thank you!