cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the file name(s) from a Multi File Reader

mxpeskir
New Contributor

I have a Multi File Reader reading a series of S3 files using a wildcard, and writing the data to Snowflake. There is a Mapper in between. Functionally, everything is working as expected.
I’d like to get the name of the file in which the data was read, and write it to a Meta_FileName column. How do I retrieve the file name from the Multi File Reader? I’m sort of assuming it’s an expression to be added in the Mapper but not sure. TIA!

14 REPLIES 14

KishorePradeep
New Contributor

Hi Snaplogic Team,

Could you please advise on the solution for the same?

cstewart
Former Employee

See the thread here

sghneim
New Contributor

Was this ever resolved I am facing the same issue currently pulling files from s3 then using json parser and mapper to write data into a file. Is there a way to get the file name in a column ?

I am using the multi file reader.

@sghneim

Please find the attached sample pipeline:

Sample_pipe_2022_01_15.slp (7.9 KB)

Hope this helps.

Regards,
Spiro Taleski

Hi Spiro,

i am getting an error on the join shape .
join.
error

not sure what i am doing wrong. my multifile reader is set with a wildcard and the subfolders option is checked. any idea what might be the cause of this error ?