Last active
February 26, 2018 11:31
-
-
Save lad1337/67f0f17d2fcd2cf638b5b0376f13521a to your computer and use it in GitHub Desktop.
SequalPro: copy as Jira/MD table in python (very very naive)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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