Skip to content

Commit

Permalink
Merge pull request maximilianh#209 from pcm32/patch-7
Browse files Browse the repository at this point in the history
Sanitises initial underscores in field names
  • Loading branch information
maximilianh committed Mar 19, 2021
2 parents 58dd3c2 + 031b65d commit 843d006
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cbPyLib/cellbrowser/cellbrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,10 +587,10 @@ def sanitizeHeaders(headers):
logging.error("This often happens with Excel files. Make sure that the conversion from Excel was done correctly. Use cut -f-lastColumn to remove empty trailing columns.")
errAbort("abort")

# Python does not accept headers that start with a digit
# Python does not accept headers that start with a digit or underscore
filtHeads = []
for h in headers:
if h[0].isdigit():
if h[0].isdigit() or h[0] == '_':
filtHeads.append("x"+h)
else:
filtHeads.append(h)
Expand Down

0 comments on commit 843d006

Please sign in to comment.