# Get filename - auto\_filling

**URL:** <https://forum.cloverdx.com/t/get-filename-auto-filling/503>\
**Category:** CloverDX Platform\
**Created:** [April 14, 2009, 12:00am UTC](https://forum.cloverdx.com/t/get-filename-auto-filling/503 "2009-04-14T00:00:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cloveuser](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@cloveuser](https://forum.cloverdx.com/u/cloveuser)\
**Post date:** [April 14, 2009, 12:00am UTC](https://forum.cloverdx.com/t/get-filename-auto-filling/503/1 "2009-04-14T00:00:00Z")

</div>

Hi,

I am reading multiple files from a location (\*.txt). I want to get the name of the file to enter into database. I tried using auto\_filling to capture the source\_name but it fails.

Can you please let me know how to capture the filename?

Thanks  
Nag

Attached code below:

\<?xml version="1.0" encoding="UTF-8"?\>

---

<div class="post-metadata">

**Author:** ![avackova](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@avackova](https://forum.cloverdx.com/u/avackova)\
**Post date:** [April 15, 2009, 9:15am UTC](https://forum.cloverdx.com/t/get-filename-auto-filling/503/2 "2009-04-15T09:15:57Z")

</div>

Hello,  
you have duplicated delimiter after the last field. Your metadata should look like follows:

```auto
<Metadata id="Metadata4" previewAttachment="C:/eclipse_workspace/testinsert/data-in/data1${PROJECT}txt" previewAttachmentCharset="ISO-8859-1">
<Record fieldDelimiter="," name="recordName5" previewAttachmentCharset="ISO-8859-1" skipFirstLine="false" type="delimited">
<Field name="First_Name" size="50" type="string"/>
<Field name="Last_Name" size="50" type="string"/>
<Field delimiter="\n" name="Salary" size="10" type="number"/>
<Field auto_filling="source_name" delimiter="\r\n" eofAsDelimiter="true" name="filename" size="100" type="string"/>
</Record>
</Metadata>

```

---

<div class="post-metadata">

**Author:** ![cloveuser](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@cloveuser](https://forum.cloverdx.com/u/cloveuser)\
**Post date:** [April 15, 2009, 5:55pm UTC](https://forum.cloverdx.com/t/get-filename-auto-filling/503/3 "2009-04-15T17:55:20Z")

</div>

Thanks for the reply.

I got rid of the duplicate metadata. It still did not work. I get red color on the salary field and all the values go blank.  
When I moved the position of the new field (source\_field, up and down in metadata editor), it started working.

Thanks  
Nag
