On Monday, January 5, 2015 11:12:13 AM UTC+10, ivo welch wrote: > > still not obviois. readcsv does have a dispatch for a stream (good), > but I really need a popen function. > x=readcsv(open(`gzcat myfile.csv.gz`, "r")) > is wrong. x=run(`gzcat myfiles.csv.gz`) doesn't send the output to x > for further piping as far as I can see, so readcsv(x) doesn't do it. >
The documentation I linked said: open(*command*, *mode::AbstractString="r"*, *stdio=DevNull*) Start running command asynchronously, and return a tuple (stream,process) you need to pass the stream element of the tuple to readcsv() Cheers Lex > /iaw > > ---- > Ivo Welch ([email protected] <javascript:>) > http://www.ivo-welch.info/ > ---- > Ivo Welch ([email protected] <javascript:>) > http://www.ivo-welch.info/ > J. Fred Weston Distinguished Professor of Finance > Anderson School at UCLA, C519 > Director, UCLA Anderson Fink Center for Finance and Investments > Free Finance Textbook, http://book.ivo-welch.info/ > Exec Editor, Critical Finance Review, > http://www.critical-finance-review.org/ > Editor and Publisher, FAMe, http://www.fame-jagazine.com/ > > > On Sun, Jan 4, 2015 at 4:55 PM, <[email protected] <javascript:>> wrote: > > > > > > On Monday, January 5, 2015 9:51:18 AM UTC+10, ivo welch wrote: > >> > >> > >> dear julia users: beginner's question (apologies, more will be > coming). > >> it's probably obvious. > >> > >> I am storing files in compressed csv form. I want to use the built-in > >> julia readcsv() function. but I also need to pipe through a > decompressor > >> first. so, I tried a variety of forms, like > >> > >> d= readcsv("/usr/bin/gzcat ./myfile.csv.gz |") > >> d= readcsv("`/usr/bin/gzcat ./myfile.csv.gz`") > >> > >> I can type the file with run(`/usr/bin/gzcat ./crsp90.csv.gz"), but > >> wrapping a readcsv around it does not capture it. how does one do > this? > > > > > > Can you run the command with open() > > > http://docs.julialang.org/en/latest/stdlib/base/?highlight=spawn#Base.open > > and pass the stream it returns to readcsv? > > > > Cheers > > Lex > > > > > >> > >> > >> regards, > >> > >> /iaw > >> > > >
