How to extract only the first file?

Describe the problem/error/question

I have a folder that contains multiple files and I want to extract only the first file. How can I do this?

What is the error message (if any)?

The item has no binary field ‘data[0]’ [item 0]

Please share your workflow

Information on your n8n setup

  • **n8n version:1.89.2
  • **Database (default: SQLite):default
  • **n8n EXECUTIONS_PROCESS setting (default: own, main):default
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):npm
  • **Operating system:Windows Server 2022

Hi,

Isn’t this a similar question as the last one?

The most “economical” way to do it is to get a list of files without actually reading them…

So maybe like “execute command”, get the list of files you need, take only the first one, read from disk and decompress that one.

In any other case, you would need to read a lot of files (potentially big) just to decompress the first one… There’s a lot of potential for this to go wrong. In addition it’s very resource intensive

Reg
J.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.