I've multiple csv files in the folder and I want to extract all files name with extension and store those list of files names in separate csv file.
I want output as this.
how to do that in apache nifi?
I tried listfile
processor but it is only giving files with data not file names. I only need file names.
You are just a step away from getting your solution. The ListFile
processor is what you need to achieve what you are looking for.
You need to setup a Record Writer
in your case you can use the CSVRecordSetWriter
When a Record Writer is configured, a single FlowFile will be created that will contain a Record for each file in the directory, instead of a separate FlowFile per file.
From here on you can use QueryRecord
processor and use a simple SQL query to get just the columns that you need for further processing.