mirror of
https://github.com/johnkerl/miller.git
synced 2026-01-23 10:15:36 +00:00
python/make-tsv.py
This commit is contained in:
parent
3ff43fa818
commit
9004098499
1 changed files with 21 additions and 0 deletions
21
python/make-tsv.py
Executable file
21
python/make-tsv.py
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
|
||||
nrow = 2
|
||||
ncol = 100
|
||||
if len(sys.argv) == 2:
|
||||
ncol = int(sys.argv[1])
|
||||
if len(sys.argv) == 3:
|
||||
nrow = int(sys.argv[1])
|
||||
ncol = int(sys.argv[2])
|
||||
|
||||
prefix = "k"
|
||||
for i in range(nrow):
|
||||
for j in range(ncol):
|
||||
if j == 0:
|
||||
sys.stdout.write("%s%07d" % (prefix, j))
|
||||
else:
|
||||
sys.stdout.write("\t%s%07d" % (prefix, j))
|
||||
sys.stdout.write("\n")
|
||||
prefix = "v"
|
||||
Loading…
Add table
Add a link
Reference in a new issue