# how to load csv into a table and make it keyed at the meantime,

**URL:** <https://forum.kx.com/t/how-to-load-csv-into-a-table-and-make-it-keyed-at-the-meantime/12120>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [March 17, 2021, 3:20pm UTC](https://forum.kx.com/t/how-to-load-csv-into-a-table-and-make-it-keyed-at-the-meantime/12120 "2021-03-17T15:20:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![charles\_upboy](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@charles\_upboy](https://forum.kx.com/u/charles_upboy)\
**Post date:** [March 17, 2021, 3:20pm UTC](https://forum.kx.com/t/how-to-load-csv-into-a-table-and-make-it-keyed-at-the-meantime/12120/1 "2021-03-17T15:20:00Z")

</div>

how to load csv into a table and make it keyed at the meantime, thanks

---

<div class="post-metadata">

**Author:** ![robert\_coen](https://avatars.discourse-cdn.com/v4/letter/r/b5e925/32.png) [@robert\_coen](https://forum.kx.com/u/robert_coen)\
**Post date:** [March 17, 2021, 5:33pm UTC](https://forum.kx.com/t/how-to-load-csv-into-a-table-and-make-it-keyed-at-the-meantime/12120/2 "2021-03-17T17:33:00Z")

</div>

One way of keying the first column of a table as they’re being loading in is to use&nbsp;

**&nbsp; &nbsp; 1!(“\*\*\*”;enlist",") 0: `:path/to/example.csv**  
Alternatively you can use xkey to speicify which column you want keyed

&nbsp; &nbsp;&nbsp;**`column xkey ("***";enlist",") 0: `:path/to/example.csv**

---

<div class="post-metadata">

**Author:** ![charles\_upboy](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@charles\_upboy](https://forum.kx.com/u/charles_upboy)\
**Post date:** [March 18, 2021, 12:58am UTC](https://forum.kx.com/t/how-to-load-csv-into-a-table-and-make-it-keyed-at-the-meantime/12120/3 "2021-03-18T00:58:00Z")

</div>

thanks, I now use xkey, it’s more flexible

?2021?3?18??? UTC+8 ??2:10:56\<rober…@aquaq.co.uk\> ???

> One way of keying the first column of a table as they’re being loading in is to use&nbsp;  
> **&nbsp; &nbsp; 1!(“\*\*\*”;enlist",") 0: `:path/to/example.csv**  
> Alternatively you can use xkey to speicify which column you want keyed
> 
> &nbsp; &nbsp;&nbsp;**`column xkey ("***";enlist",") 0: `:path/to/example.csv**
