Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with mapsubtrees #27

Closed
xiaodaigh opened this issue Aug 25, 2020 · 1 comment
Closed

Issue with mapsubtrees #27

xiaodaigh opened this issue Aug 25, 2020 · 1 comment

Comments

@xiaodaigh
Copy link

I tried to do a mapsubtrees which after I should be able to do reducevalues but it is no allowing me. See MWE below

mkdir("plsdel")
mkdir("plsdel/folder_a")
mkdir("plsdel/folder_b")

using DataFrames, FileTrees, CSV
a = DataFrame(a = 1:100)
b = DataFrame(a = 1:100)

CSV.write("plsdel/folder_a/a.csv", a)
CSV.write("plsdel/folder_b/a.csv", b)


ft = FileTree("plsdel")

ft2 = mapsubtrees(ft, r"folder") do file
    f = file |> FileTrees.path |> string
    CSV.read(joinpath("plsdel", f, "a.csv"))
end
reducevalues(vcat, ft2)
@shashi
Copy link
Owner

shashi commented Aug 25, 2020

reducevalues(vcat, ft2, dirs=true)

Arguably that should be default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants