Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Alexist
Contributor II
Contributor II

loop with a tFileOutputDelimited path = tFileInputDelimited path

Hello everyone,

I had a funny issues and I wanted to ask to the community if this is normal or not.

In one of my flow I want to use a loop. This loop will give me the possibility of changing a file line by line.

For this the path of my tFileOutputDelimited is the same than the path of my tFileInputDelimited.

It present it self like this :

0695b00000aFibtAAC.png

Like this I want to operate again and again on the same file.

The problem is, if I do this my file end empty. I had to use the "append" option. Then remove the begining of my file.

Do you know how to loop like this with an output path same as the input path without emptying the file please ?

Best regards

Labels (3)
2 Replies
Anonymous
Not applicable

Are you trying to read and write to the same file? How are you removing the beginning of the file? Also, this flow will not process the data line by line. Components are not guaranteed to process a single line, end to end, before moving to the nest line.

 

What is the objective here? There will be a better way of achieving this objective.

RJLC
Contributor
Contributor

If you want to use the same file for the input and output of a process: one option would be to divide the

 

Process in steps:

 

A) read the file and dump it into a hash (if it is not too large a file)

 

B) the input of information for the process of generating the output file, instead of the file itself, will be the hash that has been loaded in the step. A)

 

There are more options, but this one can help.

 

Greetings