I am trying to delete a column from a table without the loss of data so the data can be reinstated again but when the table is loaded up by q process the deleted column will not show. Obviously my code below will not work. Is there something specific to q that can do that? dir is where the table is and c is the column to be deleted.
{[dir;t;c] delete c from (` sv (dir,t),`)}
kdb+ has an easy way to "remove" a column without actually deleting the column data. If you look in the directory where your table is stored, you should be able to identify a
.d
file. This is where kdb+ stores the correct order of your table columns. To remove the column, simply delete the column name from this.d
file. For example:Once removed, kdb+ will not associate the column with your table and it will not be displayed when called into memory.
Hope this helps.