Welcome Guest! Log in

Topic-icon Solved Truncate a file before a loop

More
10 Dec 2015 12:49 - 10 Dec 2015 15:21 #1 by Josserand BRINON
Truncate a file before a loop was created by Josserand BRINON
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.

Please Log in or Create an account to join the conversation.

More
10 Dec 2015 14:52 #2 by Cyril Dussud
Replied by Cyril Dussud on 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:

Please Log in or Create an account to join the conversation.

More
10 Dec 2015 15:20 #3 by Josserand BRINON
Replied by Josserand BRINON on topic Truncate a file before a loop
Perfect, it works :)
Thank you!

Please Log in or Create an account to join the conversation.