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

Add option for the columns names if --no-header-row is used #1004

Open
hktonylee opened this issue Nov 27, 2018 · 2 comments
Open

Add option for the columns names if --no-header-row is used #1004

hktonylee opened this issue Nov 27, 2018 · 2 comments

Comments

@hktonylee
Copy link

hktonylee commented Nov 27, 2018

Currently if I use csvlook --no-header-row, it will generate alphabet sequence. However the sequence is generated in the way that it is super long for many columns. Let's say if the file have 500 columns. It will generate:

a, b, ..., y, z, aa, bb, cc, ... , yy, zz, aaa, bbb, ... , yyy, zzz, aaaa, bbbb, ...

In the last column, the column header will be like ggggggggggggggggggg. That is crazily long. And it is useless because I can't tell difference between ggggggggggggggggggg (500) and ggggggggggggggggg (474) easily.

Why not give the csvlook an option to choose from different naming methods? For example, we can provide more compact naming (just like Excel, a, b, ..., y, z, aa, ab, ac, ..., az, ba, ...). Or just simple plain number sequence (e.g. col1, col2, col3...). I would suggest to be --default-header-format=default, --default-header-format=excel and --default-header-format=number

@jpmckinney
Copy link
Member

I created an upstream issue. If it's resolved, I can add the following option:

            self.argparser.add_argument('--default-header-format', dest='default_header_format', choices=['default', 'excel'],
                                        help='If --no-header-row is set, specify the default header format as "default" (a,b,c,...,aa,bb,cc,....) or "excel" (A,B,C,...,AA,AB,AC,...).')

@jpmckinney
Copy link
Member

jpmckinney commented Jan 2, 2019

wireservice/agate#724

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

2 participants