File Reading Processor
5 min
the filereader processor reads the contents of a file and returns them as a string in the output payload's value field why use the filereader processor use this processor when your flow needs to bring in file based data, such as a csv export or a text file written by another system, rather than data that already arrives as a message payload how it works choosing the file if file name is empty, the processor gets the filename from the filename field of the incoming payload otherwise, it uses the value entered in file name if generate filename from expression is enabled, the processor evaluates file name as an expression instead of using it literally for example, to build a filename from a connection named aaa 's path and name fields, the expression would be aaa path + aaa name + " txt" static text within an expression must be in quotes controlling rereads normally, an incoming message triggers a file read only if the file has changed since it was last read time interval in seconds overrides this it forces the file to be treated as unmodified again after the set interval, so the next incoming message re reads it even if the file's contents haven't changed changing any of the processor's settings also resets this unmodified status enter 0 to never force a re read; the file is then read only when it actually changes caution setting file size limit in mb to 0 removes the size limit entirely, letting files of any size be read this can lead to excessive cpu, memory, and storage use reading csv files when input file type is set to csv , these parameters apply csv comma sets the delimiter character only the first character you enter is used csv columns mode determines how column names are assigned indexed assumes the file has no header row and names fields fieldxxx from header takes field names from the csv file's header row custom takes field names from the csv customs columns field when input file type is set to value only , the processor writes the file's contents directly to the value field instead of parsing columns output format data output mode controls whether the processor sends the file's data as a single message or as one message per record per record output isn't supported for binary or json files parameters parameter details file name the name of the file to read generate filename from expression when enabled, evaluates file name as an expression instead of using it literally input file type the format of the file, for example, json, csv, or parquet determines how the processor parses the file's content file size limit in mb the maximum file size, in megabytes, that the processor reads files that exceed this limit are skipped time interval in seconds forces the file to be treated as unmodified again after this interval, so it's reread on the next incoming message even without a change enter 0 to never force a re read data output mode whether the file's data is sent as a single message or one message per record csv comma the delimiter character for csv files only the first character entered is used csv columns mode how column names are assigned when reading a csv file indexed, from header, or custom csv customs columns the custom column names to use when csv columns mode is set to custom