harelba / q

q - Run SQL directly on delimited files and multi-file sqlite databases
http://harelba.github.io/q/
GNU General Public License v3.0
10.15k stars 419 forks source link

header mis-interpretation #315

Open ssbertilson opened 1 year ago

ssbertilson commented 1 year ago

Using TAB delimited header (-T) when running v3.1.6: A file with the header that I've attached is generating an error that makes it appear that it is parsing the header with additional field separators: export_csv_20230418-185741-header.csv

The error I'm seeing: Bad header row: Header must contain only strings and not numbers or empty strings: 'Start Netmask Prefix Name Terminal Class,param:,domain Class,param:,mid Class,param:,workgroup Class,param:,region Class,param:,vrf Class,param:,eip_acls Class,param:,dhcp_failover_name Class,param:,gateway Network,class,parameters,(all)' 'param:': Column name is duplicated Traceback (most recent call last): File "", line 1540, in _execute File "", line 1507, in _ensure_data_is_loaded File "", line 1485, in _load_data File "", line 1125, in populate File "", line 1091, in _populate File "", line 1149, in _insert_row File "", line 1250, in try_to_create_table File "", line 649, in analyze File "", line 714, in do_analysis File "", line 766, in infer_column_names BadHeaderException: Header must contain only strings and not numbers or empty strings: 'Start Netmask Prefix Name Terminal Class,param:,domain Class,param:,mid Class,param:,workgroup Class,param:,region Class,param:,vrf Class,param:,eip_acls Class,param:,dhcp_failover_name Class,param:,gateway Network,class,parameters,(all)' 'param:': Column name is duplicated

dserodio commented 3 months ago

It looks like the error message is telling you exactly what's wrong:

'param:': Column name is duplicated

You have more than one column called param:. Try fixing it by renaming the additional param columns as param2, param3, etc.