# Re: \[personal kdb+\] Pass a file name to script

**URL:** https://forum.kx.com/t/re-personal-kdb-pass-a-file-name-to-script/8166
**Category:** Community Support
**Tags:** kdb-and-q
**Created:** [March 4, 2013, 8:31am UTC](https://forum.kx.com/t/re-personal-kdb-pass-a-file-name-to-script/8166 "2013-03-04T08:31:00Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![prashant1](https://avatars.discourse-cdn.com/v4/letter/p/bc8723/32.png) [@prashant1](https://forum.kx.com/u/prashant1)
#### Post date: [March 4, 2013, 8:31am UTC](https://forum.kx.com/t/re-personal-kdb-pass-a-file-name-to-script/8166/1 "2013-03-04T08:31:00Z")

</div>

is it z.x or .z.x?

---

<div class="post-metadata">

### Author: ![manni\_patel](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@manni\_patel](https://forum.kx.com/u/manni_patel)
#### Post date: [March 4, 2013, 9:13am UTC](https://forum.kx.com/t/re-personal-kdb-pass-a-file-name-to-script/8166/2 "2013-03-04T09:13:00Z")

</div>

.z.x gives a tring, which you need to put a : in front of and then cast to symbol

Sent from my iPhone

---

<div class="post-metadata">

### Author: ![WooiKent\_Lee](https://avatars.discourse-cdn.com/v4/letter/w/5f8ce5/32.png) [@WooiKent\_Lee](https://forum.kx.com/u/WooiKent_Lee)
#### Post date: [March 4, 2013, 10:07am UTC](https://forum.kx.com/t/re-personal-kdb-pass-a-file-name-to-script/8166/3 "2013-03-04T10:07:00Z")

</div>

Or you can use “hsym” too.

&nbsp;

data:(“SFJ”;“,”) 0:hsym `$.z.x 0

---

<div class="post-metadata">

### Author: ![WooiKent\_Lee](https://avatars.discourse-cdn.com/v4/letter/w/5f8ce5/32.png) [@WooiKent\_Lee](https://forum.kx.com/u/WooiKent_Lee)
#### Post date: [March 6, 2013, 9:10am UTC](https://forum.kx.com/t/re-personal-kdb-pass-a-file-name-to-script/8166/4 "2013-03-06T09:10:00Z")

</div>

hsym is a function in kdb+ that can converts a symbol into a file name,&nbsp;a hostname, or an ipaddress

---

<div class="post-metadata">

### Author: ![Ash3](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@Ash3](https://forum.kx.com/u/Ash3)
#### Post date: [March 6, 2013, 7:14pm UTC](https://forum.kx.com/t/re-personal-kdb-pass-a-file-name-to-script/8166/5 "2013-03-06T19:14:00Z")

</div>

All hsym does adds a colon “:” in front of passed symbol if it is not there already which effectively turns a file name into a file handle or a hostname into a handle to host etc. here is the hsym def: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; **_&nbsp;hysm:{$[“:”=first string x;x;`$“:”,string x]}_**
