Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

Getting a list of file names

$
0
0

I’ve been asked to convert some code from Matlab to Julia, and I am stuck right at the beginning with some Regex issues

I want the equivalent of

file_name = dir(‘A*.mmode’)
file_name = {file_name.name}

In Matlab, this will make me a matrix of however many files with the appropriate start and end bits.

I saw the following code to search for files:

searchdir(path,key) = filter(x->occursin(key,x), readdir(path))

But when I run

julia> file_name = searchdir(pwd(),^(A.+iq.mmode)$)
ERROR: syntax: invalid identifier name “.”

Any suggestions?

4 posts - 4 participants

Read full topic


Viewing all articles
Browse latest Browse all 2795

Trending Articles