0

If I want to save table table1 to csv file /tmp/table1.csv I can do it with:

`:/tmp/table1.csv 0: csv 0: table1

But what if both file name and table name come from string variables?

fname:"/tmp/table1.csv"
tname: "table1"
/ how do I save table tname to file fname?

1 Answer 1

2

This should work:

hsym[`$fname] 0: csv 0: value `$tname

https://code.kx.com/q/ref/filewords/#hsym

and valuing a symbol, returns the value of the variable it names.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.