← All nodes
Parsing

File Type Sniffer

Adds a File Type column — csv, pdf, json, xlsx, … or unknown — to a list of files, from your own name rules, the extension and the file's first bytes.

When to use it

Use it on a folder of mixed files so each kind can go its own way: a Filter Rows on File Type sends CSVs to one branch and PDFs to another.

In a pipeline

Settings

SettingTypeRequiredDefault or hint
File path columnselect—Default: the path an Input Folder gives
Your rules (JSON, optional)textarea—{"invoice":["INV-*.pdf"],"csv":["*.csv","*.txt"]}

Example

Sorting a mixed folder

Files from an Input Folder
File NameFull Path
sales.csvinbox/sales.csv
INV-0042.pdfinbox/INV-0042.pdf
notesinbox/notes
With their type
File NameFull PathFile Type
sales.csvinbox/sales.csvcsv
INV-0042.pdfinbox/INV-0042.pdfpdf
notesinbox/notesunknown

Had notes been a JSON file on the server, its first bytes would have made it json.

Worth knowing

  • The node has one output; the branches are ordinary Filter Rows nodes on File Type (e.g. File Type = pdf).
  • Your rules (JSON) map a type to name patterns and win over everything else: {"invoice":["INV-*.pdf"]}.
  • First bytes are only read for files FlowDoo can open on the server; others are typed by name, and the note says how many.
  • A file whose bytes contradict its name (a .csv that is really a PDF) gets the type its bytes say, and the note lists it.
  • Leave File path column blank to use the path an Input Folder or Google Drive list provides.

Others in Parsing