0

I want to select a column from a JuliDB database. The problem is that I can't do it with string (not a symbol that starts with :), for example:

db = loadtable("table.dat")
#This table has 3 columns named  position_1, position2, position_3
pos_num = 3
column_name = "position_$pos_num"
select(db,column_name)

If I do that, then the following error appears:

column position_3 not found.

Any suggestion?

oscarcapote
  • 417
  • 1
  • 4
  • 16

1 Answers1

1

You can create a symbol directly Symbol("position_$pos_num") or from your string with Symbol(column_name).

dberge
  • 311
  • 1
  • 5