Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

read tsv with python

# Simple Way to Read TSV Files in Python using split
ans = []
 
# open .tsv file
with open("GeekforGeeks.tsv") as f:
   
  # Read data line by line
  for line in f:
     
    # split data by tab
    # store it in list
    l=line.split('	')
     
    # append list to ans
    ans.append(l)
 
# print data line by line
for i in ans:
    print(i)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #read #tsv #python
ADD COMMENT
Topic
Name
5+9 =