mmalcek / bafi

Universal JSON, BSON, YAML, CSV, XML, mt940 converter with templates
https://mmalcek.github.io/bafi/
MIT License
105 stars 6 forks source link

Feature request : set the input format from the file extension #5

Closed kpym closed 2 years ago

kpym commented 2 years ago

Currently if we want to load a csv file with -i data.csv we have also to set the format using -f csv. May be the format can be set by default to be the file extension if it is on of the known formats.

mmalcek commented 2 years ago

Done in v1.0.15 - App tries autodetect format by extension if -f is not definned I've added also new paramater -d to define CSV delimiter

kpym commented 2 years ago

You can now probably remove all unnecessary -f from the documentation, like in :

mmalcek commented 2 years ago

updatated but note -f param still makes sense because extension may often be unusual especially for XML and CSV and also. This tool was originally meant for STDIN where format must be defined

kpym commented 2 years ago

@mmalcek I agree that -f is absolutely necessary (even if we can guess the format from the data) when reading from stdin or when the file extension is not standard. But I suggest to remove it only from the examples where -f is redundant with the extension in -i.