# Is it possible to transfer files using a file pattern in data transfer component or any other component

**URL:** <https://matillioncommunity.discourse.group/t/is-it-possible-to-transfer-files-using-a-file-pattern-in-data-transfer-component-or-any-other-component/1167>\
**Category:** Matillion ETL\
**Created:** [August 18, 2020, 5:47pm UTC](https://matillioncommunity.discourse.group/t/is-it-possible-to-transfer-files-using-a-file-pattern-in-data-transfer-component-or-any-other-component/1167 "2020-08-18T17:47:49Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![RK](https://avatars.discourse-cdn.com/v4/letter/r/ce73a5/32.png) [@RK](https://matillioncommunity.discourse.group/u/RK)\
**Post date:** [August 18, 2020, 5:47pm UTC](https://matillioncommunity.discourse.group/t/is-it-possible-to-transfer-files-using-a-file-pattern-in-data-transfer-component-or-any-other-component/1167/1 "2020-08-18T17:47:49Z")

</div>

Hi ,

We need to transfer files from a remote sftp server to blob by using file pattern instead of giving exact file name.Currently we are transferring files giving the exact name in the data transfer component.Is it possible to transfer files using a file pattern in data transfer component or any other component

---

<div class="post-metadata">

**Author:** ![MEvanma](https://avatars.discourse-cdn.com/v4/letter/m/9e8a1a/32.png) [@MEvanma](https://matillioncommunity.discourse.group/u/MEvanma)\
**Post date:** [August 19, 2020, 11:28am UTC](https://matillioncommunity.discourse.group/t/is-it-possible-to-transfer-files-using-a-file-pattern-in-data-transfer-component-or-any-other-component/1167/2 "2020-08-19T11:28:42Z")

</div>

I need to do the exact same thing. It seems like it should be possible using the File Iterator component in conjunction with the Data Transfer component, but I cannot get that to work. The File Iterator allows for Regex matching and supports SFTP. You might give it a try. I cannot seem to get it to work for me using SFTP. I've submitted a case to see if I'm doing something wrong.

---

<div class="post-metadata">

**Author:** ![PRNuttall](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@PRNuttall](https://matillioncommunity.discourse.group/u/PRNuttall)\
**Post date:** [August 19, 2020, 1:18pm UTC](https://matillioncommunity.discourse.group/t/is-it-possible-to-transfer-files-using-a-file-pattern-in-data-transfer-component-or-any-other-component/1167/3 "2020-08-19T13:18:18Z")

</div>

It's possible by first building a grid variable of "source" details using an sftp File Iterator, then using a Grid Iterator to transfer each "source" file individually.

Doesn't feel like the most elegant solution but it works and allows you to control the target location relatively easily.

&nbsp;

 ![0694G00000AuPS4QAN_0D74G000006XqVUSA0](https://us1.discourse-cdn.com/flex002/uploads/matillioncommunity/original/1X/03fdb1bd44e8b48eb84cd1d616d599fa6f30398f.png)

---

<div class="post-metadata">

**Author:** ![PRNuttall](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@PRNuttall](https://matillioncommunity.discourse.group/u/PRNuttall)\
**Post date:** [August 19, 2020, 1:22pm UTC](https://matillioncommunity.discourse.group/t/is-it-possible-to-transfer-files-using-a-file-pattern-in-data-transfer-component-or-any-other-component/1167/4 "2020-08-19T13:22:33Z")

</div>

...and include your regex in the initial SFTP File Iterator.

---

<div class="post-metadata">

**Author:** ![MEvanma](https://avatars.discourse-cdn.com/v4/letter/m/9e8a1a/32.png) [@MEvanma](https://matillioncommunity.discourse.group/u/MEvanma)\
**Post date:** [August 19, 2020, 1:24pm UTC](https://matillioncommunity.discourse.group/t/is-it-possible-to-transfer-files-using-a-file-pattern-in-data-transfer-component-or-any-other-component/1167/5 "2020-08-19T13:24:21Z")

</div>

I'm trying to do this, but no matter how I configure the File Iterator, I get either "Exception: Error opening sftp connection" or "Exception: 2: File not found: /" - I'm unclear if I have the URL specified correctly.

---

<div class="post-metadata">

**Author:** ![RK](https://avatars.discourse-cdn.com/v4/letter/r/ce73a5/32.png) [@RK](https://matillioncommunity.discourse.group/u/RK)\
**Post date:** [August 19, 2020, 2:30pm UTC](https://matillioncommunity.discourse.group/t/is-it-possible-to-transfer-files-using-a-file-pattern-in-data-transfer-component-or-any-other-component/1167/6 "2020-08-19T14:30:07Z")

</div>

Hi,

&nbsp;

Can you please show how you have defined the parameters for file iterator and data transfer components ? I am many interested in the input url, variables for file iterator and target filename in the data transfer component as the target file name in the data transfer component need to change for each of the file that is transfereed

---

<div class="post-metadata">

**Author:** ![MEvanma](https://avatars.discourse-cdn.com/v4/letter/m/9e8a1a/32.png) [@MEvanma](https://matillioncommunity.discourse.group/u/MEvanma)\
**Post date:** [August 19, 2020, 1:25pm UTC](https://matillioncommunity.discourse.group/t/is-it-possible-to-transfer-files-using-a-file-pattern-in-data-transfer-component-or-any-other-component/1167/7 "2020-08-19T13:25:59Z")

</div>

I should note that the Data Transfer component works fine for me with a specific file name.

---

<div class="post-metadata">

**Author:** ![PRNuttall](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@PRNuttall](https://matillioncommunity.discourse.group/u/PRNuttall)\
**Post date:** [August 19, 2020, 1:35pm UTC](https://matillioncommunity.discourse.group/t/is-it-possible-to-transfer-files-using-a-file-pattern-in-data-transfer-component-or-any-other-component/1167/8 "2020-08-19T13:35:34Z")

</div>

File not found sounds more promising...

&nbsp;

We had an issue where the file path needed to be included in the regex or appended to the SFTP url.

regex pattern matches are against fully qualified filenames rather than just the name.

---

<div class="post-metadata">

**Author:** ![MEvanma](https://avatars.discourse-cdn.com/v4/letter/m/9e8a1a/32.png) [@MEvanma](https://matillioncommunity.discourse.group/u/MEvanma)\
**Post date:** [August 19, 2020, 2:31pm UTC](https://matillioncommunity.discourse.group/t/is-it-possible-to-transfer-files-using-a-file-pattern-in-data-transfer-component-or-any-other-component/1167/9 "2020-08-19T14:31:06Z")

</div>

I've been playing with that, but so far nothing but "File not found: /". Thanks again for your suggestions.

---

<div class="post-metadata">

**Author:** ![RK](https://avatars.discourse-cdn.com/v4/letter/r/ce73a5/32.png) [@RK](https://matillioncommunity.discourse.group/u/RK)\
**Post date:** [September 9, 2020, 7:25pm UTC](https://matillioncommunity.discourse.group/t/is-it-possible-to-transfer-files-using-a-file-pattern-in-data-transfer-component-or-any-other-component/1167/10 "2020-09-09T19:25:51Z")

</div>

Hi,

Can you share the mapping by exporting it ? so that we can reuse it by making appropriate changes

---

<div class="post-metadata">

**Author:** ![ManiSubramanian](https://avatars.discourse-cdn.com/v4/letter/m/f475e1/32.png) [@ManiSubramanian](https://matillioncommunity.discourse.group/u/ManiSubramanian)\
**Post date:** [August 20, 2020, 2:32pm UTC](https://matillioncommunity.discourse.group/t/is-it-possible-to-transfer-files-using-a-file-pattern-in-data-transfer-component-or-any-other-component/1167/11 "2020-08-20T14:32:56Z")

</div>

I am getting the following error com.jcraft.jsch.JSchException: Auth cancel

&nbsp;

Has anyone else see this?

---

<div class="post-metadata">

**Author:** ![PRNuttall](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@PRNuttall](https://matillioncommunity.discourse.group/u/PRNuttall)\
**Post date:** [August 20, 2020, 8:13am UTC](https://matillioncommunity.discourse.group/t/is-it-possible-to-transfer-files-using-a-file-pattern-in-data-transfer-component-or-any-other-component/1167/12 "2020-08-20T08:13:27Z")

</div>

![0694G00000AuSQVQA3_0D74G000006XqlSSAS](https://us1.discourse-cdn.com/flex002/uploads/matillioncommunity/original/1X/aefcefdd22dea892cc0d461e16ffcbc1c3aa7f30.png)

 ![0694G00000AuSPdQAN_0D74G000006XqlSSAS](https://us1.discourse-cdn.com/flex002/uploads/matillioncommunity/original/1X/32395c8c2242a8f05a5ae9c199c9210d4de5cb96.png)

 ![0694G00000AuSQkQAN_0D74G000006XqlSSAS](https://us1.discourse-cdn.com/flex002/uploads/matillioncommunity/original/1X/e9cc4140be79c4913bfc1cae81753cb7153e7ea1.png)

&nbsp;

﻿

 ![0694G00000AuSQzQAN_0D74G000006XqlSSAS](https://us1.discourse-cdn.com/flex002/uploads/matillioncommunity/original/1X/18daa828e32995afed8800048453dd164a16dc53.png)

---

<div class="post-metadata">

**Author:** ![PRNuttall](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@PRNuttall](https://matillioncommunity.discourse.group/u/PRNuttall)\
**Post date:** [August 20, 2020, 8:23am UTC](https://matillioncommunity.discourse.group/t/is-it-possible-to-transfer-files-using-a-file-pattern-in-data-transfer-component-or-any-other-component/1167/13 "2020-08-20T08:23:36Z")

</div>

See screenshots above for example of the File Iterator.

Have you confirmed files exists in the home directory and/or enabled the recursive option?

---

<div class="post-metadata">

**Author:** ![MEvanma](https://avatars.discourse-cdn.com/v4/letter/m/9e8a1a/32.png) [@MEvanma](https://matillioncommunity.discourse.group/u/MEvanma)\
**Post date:** [August 20, 2020, 10:38am UTC](https://matillioncommunity.discourse.group/t/is-it-possible-to-transfer-files-using-a-file-pattern-in-data-transfer-component-or-any-other-component/1167/14 "2020-08-20T10:38:21Z")

</div>

Thanks so much for this. **The key was to set "Set Home Directory as Root" to YES**. I had it set to the default value of NO and that wasn't working. It now works for me. Thanks!

---

<div class="post-metadata">

**Author:** ![MEvanma](https://avatars.discourse-cdn.com/v4/letter/m/9e8a1a/32.png) [@MEvanma](https://matillioncommunity.discourse.group/u/MEvanma)\
**Post date:** [August 21, 2020, 11:08am UTC](https://matillioncommunity.discourse.group/t/is-it-possible-to-transfer-files-using-a-file-pattern-in-data-transfer-component-or-any-other-component/1167/15 "2020-08-21T11:08:59Z")

</div>

I have not. Mine is working now. Sorry you're continuing to have problems. Are you able to transfer a single known file using the Data Transfer component?

---

<div class="post-metadata">

**Author:** ![ManiSubramanian](https://avatars.discourse-cdn.com/v4/letter/m/f475e1/32.png) [@ManiSubramanian](https://matillioncommunity.discourse.group/u/ManiSubramanian)\
**Post date:** [August 21, 2020, 1:11pm UTC](https://matillioncommunity.discourse.group/t/is-it-possible-to-transfer-files-using-a-file-pattern-in-data-transfer-component-or-any-other-component/1167/16 "2020-08-21T13:11:15Z")

</div>

Not able to connect to the server.

&nbsp;
