Last active
April 26, 2018 06:45
-
-
Save tuttelikz/53ecc6f58c41fd72b075ba322b643f1b to your computer and use it in GitHub Desktop.
Instructions on how to convert TSV to CSV file
This file contains 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
First, add to file and name it as csv2tab.sh the following script: | |
########################################################################### | |
#!/usr/bin/env python | |
import csv, sys | |
csv.writer(sys.stdout, dialect='excel-tab').writerows(csv.reader(sys.stdin)) | |
########################################################################### | |
Then, locate your terminal to the directory where you saved .sh file and give it execution permissions with: | |
########################################################################### | |
chmod +x the_file_name | |
########################################################################### | |
After, just call the script and give your preferred filenames: | |
########################################################################### | |
./csv2tab.sh < data.csv > data.tsv && head data.tsv | |
########################################################################### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment