Skip to content

Commit 5778070

Browse files
committed
Ensure a column name for no-name columns
1 parent ddf26fd commit 5778070

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

HISTORY.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
=========
33

4+
2022-02-04a : v0.12.2 'Filling the blanks !'
5+
--------------------------------------------
6+
7+
* empty columns names are always replaced per the default 'c_nnn' convention
8+
9+
410
2021-08-15a : v0.12.1 'Pop-up results to excel !'
511
-------------------------------------------------
612

sqlite_bro/sqlite_bro.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class App:
4040

4141
def __init__(self, use_gui=True):
4242
"""create a tkk graphic interface with a main window tk_win"""
43-
self.__version__ = "0.12.1"
44-
self._title = "of 2021-08-15a : 'Pop-up results to .excel !'"
43+
self.__version__ = "0.12.2"
44+
self._title = "of 2022-02-04a : 'Filling the blanks !'"
4545
self.conn = None # Baresql database object
4646
self.database_file = ""
4747
self.initialdir = "."
@@ -1619,7 +1619,10 @@ def guess_sql_creation(table_name, separ, decim, header, data, quoter='"'):
16191619
if header:
16201620
# de-duplicate column names, if needed by pastixing with '_'+number
16211621
for i in range(len(r)):
1622-
if r[i] in r[:i]:
1622+
1623+
if r[i] == "": # 2022-02-04a replace empty column title per usual default
1624+
1625+
r[i] = "c_" + ("000" + str(i))[-3:] if r[i] in r[:i]:
16231626
j = 1
16241627
while r[i] + "_" + str(j) in r[:i] + r[i + 1 :]:
16251628
j += 1

0 commit comments

Comments
 (0)