LoginSignup
12
8

More than 5 years have passed since last update.

Pythonでtsvを取り込む

Last updated at Posted at 2016-09-21

結論

Pythonではtsvもcsvと同等に扱える。

コード

data.tsv
aaaa  bbb   cc    d     ee    fff   gggg
sample.py
import csv

tsvFile = file("data.tsv")
tsv = csv.reader(tsvFile, delimiter = '\t')

for s in tsv:
    print s 
console
aaaa
bbb
cc
d
ee
fff
gggg
12
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
8