Skip to content

Instantly share code, notes, and snippets.

@hornc
Created June 30, 2025 01:08
Show Gist options
  • Save hornc/8ab7c455f351e8f1ef96ec8623041a15 to your computer and use it in GitHub Desktop.
Save hornc/8ab7c455f351e8f1ef96ec8623041a15 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import argparse
import csv
def main():
parser = argparse.ArgumentParser(description='Convert CSV to TSV.')
parser.add_argument('csv', help='CSV file to convert')
args = parser.parse_args()
infile = args.csv
with open(infile, newline='') as csvfile:
csvreader = csv.reader(csvfile, delimiter=',')
for row in csvreader:
print('\t'.join(row))
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment