Need help : Write input file name to output data

Dear All,

We have a requirement where we are reading multiple files using wild-card formatting and creating one output file after some basic validations.

We also wish to write the input filename to the output file in one of the newly created field.

Is this possible ? If yes, can someone please help me here ?

Thank you in advance.

Swapnil Waramwar

Hi Swapnil,

I see there’s a ticket in our system for this as well.

Please see description on how you can write the input filename to the output file below as well:

To pass the file name in the plan output, you can use column variables. To read more about them, open a Text File Reader step and click on the question mark in the bottom left. Then, read the Detailed description section. To put it simply, instead of specifying a filename, use “{filename}.txt” and create a shadow column called filename. The curly brackets will grab all the files in that folder structure. So if I use ./data/in/{filename}.txt, it will grab all the txt files in the /data/in folder. It will grab the filename and assign it to the corresponding column.

Please let me know if you have any other questions.

Thank you.

1 Like

Thank you, working as it should. :slight_smile: