編寫 TSV 檔案
Python
import csv
with open('/tmp/output.tsv', 'wt') as out_file:
tsv_writer = csv.writer(out_file, delimiter='\t')
tsv_writer.writerow(['name', 'field'])
tsv_writer.writerow(['Dijkstra', 'Computer Science'])
tsv_writer.writerow(['Shelah', 'Math'])
tsv_writer.writerow(['Aumann', 'Economic Sciences'])
輸出檔案
$ cat /tmp/output.tsv
name field
Dijkstra Computer Science
Shelah Math
Aumann Economic Sciences