You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by KhajaAsmath Mohammed <md...@gmail.com> on 2020/10/01 16:01:14 UTC

Read only txt files - Getfile

Hi,

I have folder where I need to pick up only the files that end with .txt
with getfile. I can read everything and do the route on attribute but we
will loose the files from the folder.

Thanks,
Asmath

Re: Read only txt files - Getfile

Posted by Mark Payne <ma...@hotmail.com>.
Asmath,

It’s not clear from your message exactly what you’re asking here. Are you looking for a way to tell GetFile to only read .txt files? Or to tell GetFile to not remove the files? Or both?

GetFile doesn’t keep state about what it’s picked up. It removes the file in order to avoid constantly picking the file up again. Typically, people use ListFile followed by FetchFile in order to consume the files and leave them where they are.

If you’re ok with GetFile’s behavior of removing the file, then you can just use GetFile and set the File Filter property to something like “.*\.txt” to only pick up .txt files. This property, I believe, is available on both GetFile and ListFile.

Thanks
-Mark


> On Oct 1, 2020, at 12:01 PM, KhajaAsmath Mohammed <md...@gmail.com> wrote:
> 
> Hi,
> 
> I have folder where I need to pick up only the files that end with .txt with getfile. I can read everything and do the route on attribute but we will loose the files from the folder. 
> 
> Thanks,
> Asmath