Import tsv with Python

Conclusion

In Python, tsv can be treated in the same way as csv.

code

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

Recommended Posts

Import tsv with Python
Import vtk with brew python
Working with LibreOffice in Python: import
FizzBuzz with Python3
Scraping with Python
Statistics with python
Scraping with Python
Python with Go
Twilio with Python
Integrate with Python
Play with 2016-Python
AES256 with python
Tested with Python
python starts with ()
with syntax (Python)
Bingo with python
Zundokokiyoshi with python
Excel with Python
Microcomputer with Python
Summarize Python import
Cast with python
How to import CSV and TSV files into SQLite with Python
Serial communication with Python
Zip, unzip with python
Django 1.11 started with Python3.6
Primality test with Python
Python with eclipse + PyDev.
Socket communication with Python
Data analysis with python 2
Scraping with Python (preparation)
Try scraping with Python.
Learning Python with ChemTHEATER 03
Sequential search with Python
"Object-oriented" learning with python
Run Python with VBA
Handling yaml with python
Solve AtCoder 167 with python
[Python] Use JSON with Python
Learning Python with ChemTHEATER 05-1
Learn Python with ChemTHEATER
Run prepDE.py with python3
1.1 Getting Started with Python
Collecting tweets with Python
Binarization with OpenCV / Python
3. 3. AI programming with Python
Non-blocking with Python + uWSGI
Scraping with Python + PhantomJS
Python from or import
python original module import
Posting tweets with python
Drive WebDriver with python
Use mecab with Python3
[Python] Redirect with CGIHTTPServer
Voice analysis with python
Think yaml with python
Python> Run with run-time arguments> Use import argparse
Operate Kinesis with Python
Getting Started with Python
Use DynamoDB with Python
Handle Excel with python
Ohm's Law with Python