Comments (6)
@aborruso that very much surprises me -- there is something I don't understand here & will need to dig into ...
from miller.
Thank you
from miller.
If I change the source, it works
mlr --gzin --t2c head "https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/BOP_EU6_M?format=TSV&compressed=true"
from miller.
@aborruso I believe it's because .zip
and GZIP are different things
from miller.
@aborruso I believe it's because
.zip
and GZIP are different things
Ok, but for the same source, the same zip file, I can read it locally
mlr --prepipe gunzip --csv head eurofxref-hist.zip
but I have error if I read it from its URL
mlr --prepipe gunzip --csv head "https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.zip"
Shouldn't it still read it, both locally and remotely, just like with gzip?
from miller.
@aborruso sorry for the long delay.
This was (in hindsight) obvious to me.
- Most programs like
wc
andcat
andgunzip
et al. operate on local files -- it would be very surprising for any of them to accepthttps://...
URLs as input. For such tools you need to do two steps: (a) copy to local, e.g. withwget
, and (b) usewc
,cat
,gunzip
, etc on the local copy. - Miller tries to go "above and beyond" by allowing you to read from
https://...
URLs
The key insight is that when you do
mlr --gzin --t2c head "https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/BOP_EU6_M?format=TSV&compressed=true"
then you are asking Miller -- which goes "above and beyond" by accepting https://...
URLs as input -- to open that URL, and run the data it reads from the internet, and run that through its internal zip-decoder library. This works.
But when you do
mlr --prepipe gunzip --csv head "https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.zip"
then you are asking Miller to do (effectively)
gunzip https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.zip | mlr --csv head
and of course the gunzip
program does not go "above and beyond" by accepting https://...
input.
So there is (unfortunately) nothing I can do about this.
A side note: why did I even invent mlr --prepipe
? It's because if you have
mlr --prepipe foo --... a.csv b.csv c.csv
that's simpler than having to do
for file in a.csv b.csv c.csv; do
foo $file | mlr --...
done
from miller.
Related Issues (20)
- Support markdown format on input HOT 1
- system: not able to escape single quote HOT 12
- Add support for thousands separator in `fmtnum` HOT 2
- Question related to unsparsify HOT 6
- CSV header/data length mismatch 5 != 3 on row that does not exist HOT 2
- Is there a way to "sparsify" HOT 3
- [feature request] Split by file size
- Miller produces no output on TSV with > 64K characters per line HOT 11
- [feature request] Right-align numeric values in PPRINT and Markdown output formats
- Read performance can be improved for high-column-count data
- Investigate shutdown latency on `mlr head` HOT 2
- Cryptic fatal error message for nonexistent files since 6.9.0 HOT 2
- Investigate spurious `[]` on JSON output in some cases HOT 4
- `flatten` not working on csv input data
- Bash process substitution not working with `put -f`
- Miller's `strptime` accepts fewer format options than `strptime`
- Inconsistent result when using `$*`
- Double-width characters spoil column alignment HOT 4
- `mlr --icsv --ojson cat < mlr.bug.csv` drops some columns HOT 5
- Add description for "put" verb HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from miller.