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

Allow to configure separator and quote characters per-file and/or per-project #13

Open
digulla opened this issue Dec 20, 2017 · 3 comments

Comments

@digulla
Copy link

digulla commented Dec 20, 2017

I have a mix of CSV files (some with comma, some with semi colon).

It would be great if there was a per-file and per-project preferences where I can specify the defaults.

Right now, I can just do this globally.

Related to #7

@paulvi
Copy link
Collaborator

paulvi commented Dec 21, 2017

First, it is logical problem: where to store information about delimiter (comma vs semicolon )

Option A: support more than one (any of delimiters in list.)
Option B: use different filename extension, e.g. .csv, .ssv and so on.
Option C: per project settings (I think it less favorable)

@paulvi paulvi changed the title Allow to configure separator and quote characters Allow to configure separator and quote characters per-file and/or per-project Dec 21, 2017
@digulla
Copy link
Author

digulla commented Dec 22, 2017

Many plug-ins allows to save per-file preferences.

I'm not sure whether Eclipse now has built-in support for this but what I saw is that other plug-ins create a file in /project/.settings/plug.in.id.prefs and inside they save per-file options.

The resource plugin uses this format:

encoding/path=UTF-8

The path is relative to the project root:

encoding//src/main/java=UTF-8

which is good enough for simple stuff.

Other plugins use

path=encoded options

where "encoded options" is all the options somehow compressed into a single string.

In this case, since we only have a few options, I think this approach might work:

separator=,
quote="
file/separator//src/main/resources/data/demo.csv=;

The first two lines set the defaults for the project, the third line overrides just the separator char for a certain file.

See also:

@quazardous
Copy link

Hi,

you could use some "hidden" file

for file some/path/my.csv it could be some/path/.my.csv.cec

charset=UTF8
separator=,
quote="

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

No branches or pull requests

3 participants