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
Input FolderFile Type SnifferFilter RowsLoop
Settings
| Setting | Type | Required | Default or hint |
|---|---|---|---|
| File path column | select | — | Default: the path an Input Folder gives |
| Your rules (JSON, optional) | textarea | — | {"invoice":["INV-*.pdf"],"csv":["*.csv","*.txt"]} |
Example
Sorting a mixed folder
| File Name | Full Path |
|---|---|
| sales.csv | inbox/sales.csv |
| INV-0042.pdf | inbox/INV-0042.pdf |
| notes | inbox/notes |
| File Name | Full Path | File Type |
|---|---|---|
| sales.csv | inbox/sales.csv | csv |
| INV-0042.pdf | inbox/INV-0042.pdf | |
| notes | inbox/notes | unknown |
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.