# joining strings kdb+

**URL:** <https://forum.kx.com/t/joining-strings-kdb/14227>\
**Category:** Community Support\
**Tags:** imported, other\
**Created:** [May 27, 2025, 8:13am UTC](https://forum.kx.com/t/joining-strings-kdb/14227 "2025-05-27T08:13:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dang30.swati](https://sea2.discourse-cdn.com/flex002/user_avatar/forum.kx.com/dang30.swati/32/128_2.png) [@dang30.swati](https://forum.kx.com/u/dang30.swati)\
**Post date:** [May 27, 2025, 8:13am UTC](https://forum.kx.com/t/joining-strings-kdb/14227/1 "2025-05-27T08:13:39Z")

</div>

[https://learninghub.kx.com/forums/topic/joining-strings-kdb](https://learninghub.kx.com/forums/topic/joining-strings-kdb)

why does joining these 2 strings give unexpected results?  
-\> system"pwd" = and the type is 0h as well  
-\> (system"pwd"),"/xyz.csv" //type of first string is 0h and type of "xyz.csv" is 10h as expected

---

<div class="post-metadata">

**Author:** ![ss1](https://sea2.discourse-cdn.com/flex002/user_avatar/forum.kx.com/ss1/32/128_2.png) [@ss1](https://forum.kx.com/u/ss1)\
**Post date:** [May 27, 2025, 8:33am UTC](https://forum.kx.com/t/joining-strings-kdb/14227/2 "2025-05-27T08:33:41Z")

</div>

[https://code.kx.com/q/ref/system/](https://code.kx.com/q/ref/system/)&nbsp;"returns the result as a list of character vectors."

Returns a list (0h) of character vectors (10h).

q)type system"ls -l"

0h

q)count system"ls -l"

28

q)type system"pwd"

0h

q)count system"pwd"

1

q)first system"pwd"

"/Users/myuser"

q)type first system"pwd"

10h

q)(first system"pwd"),"/some"

"/Users/myuser/some"

---

<div class="post-metadata">

**Author:** ![rocuinneagain](https://sea2.discourse-cdn.com/flex002/user_avatar/forum.kx.com/rocuinneagain/32/287_2.png) [@rocuinneagain](https://forum.kx.com/u/rocuinneagain)\
**Post date:** [May 27, 2025, 9:11am UTC](https://forum.kx.com/t/joining-strings-kdb/14227/3 "2025-05-27T09:11:05Z")

</div>

It's joining a list (of lists) to another list (of characters)

```
q)(system"pwd"),"/xyz.csv"
"/home/rocuinneagain"
"/"
"x"
"y"
"z"
"."
"c"
"s"
"v"
```

To join a list of lists to another list of lists add 'enlist'

```
q)(system"pwd"),enlist "/xyz.csv"
"/home/rocuinneagain"
"/xyz.csv"
```

To add a list of characters to a list of characters use 'first'

```
q)(first system"pwd"),"/xyz.csv"
"/home/rocuinneagain/xyz.csv"
```
