Visidata: Excel (xls, xlsx) files have no column names in the header

Created on 1 Nov 2018  路  9Comments  路  Source: saulpw/visidata

Hi,
I have this input file.

If I run vd a.xlsx and open the sheet inside I have the header cells values are row values and not header values.

image

But I think it should be in this way.

image

I have openpyxl 2.4.11 and and visidata 1.4.

Thank you

Most helpful comment

@saulpw I'm very happy, I feel myself an influencer :D :D :D

Great, thank you

All 9 comments

Hi @aborruso, this is because Excel sheels can have any number of headers and it is impossible to know how many there are. You can "hoist" the current row into the header with g^ and then ddelete the row to get the result you want.

@saulpw a feature requests: enable --header=int option also for xls and xlsx.

Thank you

This is also addressed in v1.5 with the --header option (defaulting to 1).

@saulpw I'm very happy, I feel myself an influencer :D :D :D

Great, thank you

Hi @saulpw ,
when I open the sheet inside this xls file it has no column names.

I'm using vd 1.5.

Thank you

image

This works for me. Could you try with current develop branch? If that works, then this will be fixed in 1.5.1.

hi @saulpw I'm not able to install and use vd via pip visidata, I have always python environment problem (not able to solve this).

The the way for me to have an update version is only to use the deb version.

Than I cannot make any test with develop branch :(

@aborruso did 1.5.1 fix this issue for you?

@saulpw I have always the same :(

Traceback (most recent call last):
  File "/home/andybandy/miniconda3/bin/vd", line 152, in <module>
    main()
  File "/home/andybandy/miniconda3/bin/vd", line 130, in main
    vdtui.run(*sources)
  File "/home/andybandy/miniconda3/lib/python3.6/site-packages/visidata/vdtui.py", line 2838, in run
    ret = wrapper(cursesMain, sheetlist)
  File "/home/andybandy/miniconda3/lib/python3.6/site-packages/visidata/vdtui.py", line 2828, in wrapper
    return curses.wrapper(setupcolors, f, *args)
  File "/home/andybandy/miniconda3/lib/python3.6/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/home/andybandy/miniconda3/lib/python3.6/site-packages/visidata/vdtui.py", line 2825, in setupcolors
    return f(stdscr, *args)
  File "/home/andybandy/miniconda3/lib/python3.6/site-packages/visidata/vdtui.py", line 2851, in cursesMain
    return vd().run(_scr)
  File "/home/andybandy/miniconda3/lib/python3.6/site-packages/visidata/vdtui.py", line 866, in run
    keystroke = self.getkeystroke(scr, sheet)
  File "/home/andybandy/miniconda3/lib/python3.6/site-packages/visidata/vdtui.py", line 734, in getkeystroke
    k = scr.get_wch()
AttributeError: '_curses.window' object has no attribute 'get_wch'
Was this page helpful?
0 / 5 - 0 ratings

Related issues

polm picture polm  路  4Comments

zaiste picture zaiste  路  4Comments

unhammer picture unhammer  路  3Comments

aborruso picture aborruso  路  3Comments

aborruso picture aborruso  路  3Comments