removing obsolete scripts, fixing few

This commit is contained in:
Q
2021-10-10 08:46:04 +03:00
parent 707eba3ead
commit 8640a29d00
12 changed files with 18 additions and 1337 deletions

View File

@@ -1,15 +1,14 @@
#!/bin/bash
help() {
echo 'Sqlite3NCSV: view sqlite3 DB with ncsv.
Usage: sqlite3ncsv [FILE] [TABLE/QUERY/-l]
echo 'sqlite3tabview: view sqlite3 DB with tabview.
Usage: sqlite3tabview [FILE] [TABLE/QUERY/-l]
first argument: sqlite3 file
second, optional argument:
second, optional argument:
TABLE: If not given, first in schema used.
QUERY: If the second argument contains spaces, it is assumed to be a query.
-l: List table names
note: will try for tabview if ncsv not installed
'
}
[[ "$1" == "-h" ]] && {
@@ -35,11 +34,8 @@ sqlfile="$1"
} || {
query="$table"
}
VIEWER=ncsv
which ncsv > /dev/null || {
VIEWER="tabview -w max -"
which tabview > /dev/null || VIEWER="cat -"
}
VIEWER="tabview -w max -"
which tabview > /dev/null || VIEWER="cat -"
sqlite3 -header -separator ' ' -nullvalue NA "$sqlfile" "$query" | $VIEWER

View File

@@ -17,17 +17,8 @@
#
'''TSV 2 SC convert.'''
from __future__ import division
from __future__ import print_function
from builtins import chr
from builtins import str
from builtins import range
from builtins import object
from past.utils import old_div
__author__ = "Ville Rantanen"
__version__ = "0.2"
__version__ = "0.3"
import sys,os
import csv
@@ -100,7 +91,7 @@ class SCWriter(object):
''' Returns a column alphabet from column number '''
o=chr(column+64+1)
if column>25:
return self.column_to_alpha((old_div(column, 26)) -1) + self.column_to_alpha(column % 26);
return self.column_to_alpha((int(column/ 26)) -1) + self.column_to_alpha(column % 26);
return o
def write_row(self,row):