how to convert from a character vector to a number?

Learning APL or new to Dyalog? Ask "silly" questions here, without fear...
Post Reply
AntonioDiNarzo
Posts: 6
Joined: Mon Oct 23, 2017 3:14 pm

how to convert from a character vector to a number?

Post by AntonioDiNarzo »

e.g., say I have:

Code: Select all

     ]display '12' '2.7' '721324'
┌→────────────────────┐
│ ┌→─┐ ┌→──┐ ┌→─────┐ │
│ │12│ │2.7│ │721324│ │
│ └──┘ └───┘ └──────┘ │
└∊────────────────────┘

how do I get to:

Code: Select all

     
     ]display 12 2.7 721324
┌→────────────┐
│12 2.7 721324│
└~────────────┘
paulmansour
Posts: 431
Joined: Fri Oct 03, 2008 4:14 pm

Re: how to convert from a character vector to a number?

Post by paulmansour »

See the primitive "execute" : ⍎

And also see the system function ⎕VFI

For a vector of vectors as you show, you will need to use these functions with the each operator: ¨

Alternatively you can laminate the data together in a single, blank delimited string and avoid the each operator.
Post Reply