Skip to content

Instantly share code, notes, and snippets.

@lad1337
Last active February 26, 2018 11:31
Show Gist options
  • Save lad1337/67f0f17d2fcd2cf638b5b0376f13521a to your computer and use it in GitHub Desktop.
Save lad1337/67f0f17d2fcd2cf638b5b0376f13521a to your computer and use it in GitHub Desktop.
SequalPro: copy as Jira/MD table in python (very very naive)
#!/usr/bin/env python
# choose "Select Rows (TSV)"
import sys
import os
table = ""
separator = '||'
for line in sys.stdin.readlines():
table += "{sep}{c}{sep}\n".format(c=line.replace('\t', separator).strip(), sep=separator)
separator = '|'
os.system("echo '%s' | pbcopy" % table)
#!/usr/bin/env python
# choose "Select Rows (TSV)"
import sys
import os
table = ""
separator = '|'
for index, line in enumerate(sys.stdin.readlines()):
table += "{sep}{c}{sep}\n".format(c=line.replace('\t', separator).strip(), sep=separator)
if not index:
table += ("|---" * line.count('\t')) + "|---|"
os.system("echo '%s' | pbcopy" % table)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment