> For the complete documentation index, see [llms.txt](https://doc.wearepatchworks.com/product-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/connector-shape/configuring-sftp-connections/valid-ftp-commands/pluck-ftp-command.md).

# pluck (FTP command)

### Overview

The `pluck` command retrieves a file, loads content into the process flow as a payload, and then deletes the file from the remote server.

## Need to know

* You can pluck a single file or multiple files.
* Regular expressions are supported when defining files to retrieve with the `get` command.

## Connection settings

When [configuring an SFTP connector](/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/connector-shape/configuring-sftp-connections.md), two fields should be updated:

| FTP command               | Root                                                                                                                                     | Path                           |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| FTP command only: `pluck` | <p>The root to the file(s) you want to pluck.<br><br>Since the root only applies to one directory, you can enter the full path here.</p> | The filename(s) to be plucked. |

## Example

* [Scenario](#scenario)
* [The steps](#the-steps)

### Scenario

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th data-hidden data-card-cover data-type="image">Cover image</th></tr></thead><tbody><tr><td><p>Our process flow is configured as follows:</p><p><img src="/files/eJGgx1EzeOKq8GlFvUSO" alt="" data-size="original"></p></td><td><a href="/files/rI8jPerjv9MFfSCvdBbq">/files/rI8jPerjv9MFfSCvdBbq</a></td></tr><tr><td>In this flow, we need to pluck all files in <code>/myfiles/folderB</code> that start with <code>orders</code> - so <code>orders.json</code>, <code>orders2.json</code>, <code>orders3.json</code>:<br><br><img src="/files/pAS6BkF9ibSATbFW7lwD" alt=""></td><td><a href="/files/2vpVY6Q37YrYqTgeZirK">/files/2vpVY6Q37YrYqTgeZirK</a></td></tr></tbody></table>

### The steps

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th data-hidden data-card-cover data-type="image">Cover image</th></tr></thead><tbody><tr><td><p><strong>Connector settings</strong></p><p>Our SFTP shape is configured as follows:</p><p><img src="/files/ie6PktshPK1i98yRl3fu" alt="" data-size="original"></p><ul><li>Use the <code>SFTP GET user pass</code> endpoint.</li><li>Start looking for the file to rename from the <code>root</code>, which is defined as: <code>/myfiles/folderB/</code></li><li>Check the <code>path</code> for the file(s) to pluck, which is defined as: <code>/^orders.*/i</code>. This regular expression resolves to 'all files starting with 'orders', irrespective of upper/lower case.</li></ul></td><td><a href="/files/oMb9sRQ3X0NcUlY4i8Mk">/files/oMb9sRQ3X0NcUlY4i8Mk</a></td></tr><tr><td><p><strong>Payload &#x26; SFTP server</strong></p><p>When the process flow is run, the payload for the SFTP shape shows the content retrieved from matched files. We have three payloads:</p><p><img src="/files/qO0PgwaPQEoaW2Fdrjcl" alt="" data-size="original"></p><p>On our remote server, all 'orders' files have been removed from <code>/myfiles/folderB/</code> and this directory is now empty:<br><br><img src="/files/jluBsCcBoQQwUFsfzkeq" alt=""></p></td><td><a href="/files/J6YFhcQQMgUmK2sBQwdu">/files/J6YFhcQQMgUmK2sBQwdu</a></td></tr></tbody></table>
