By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,986 Members | 1,568 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,986 IT Pros & Developers. It's quick & easy.

how to read a tab delimited file

P: n/a
how would i read a tab delimited file? at the same time put what i
read in an array, say for example that i know that the file is an
array with column= 5 and row=unknown.
Jul 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
jrlen balane wrote:
how would i read a tab delimited file? at the same time put what i
read in an array, say for example that i know that the file is an
array with column= 5 and row=unknown.


Use the "csv" module. Although that stands for "comma
separated values", it readily supports alternative
delimiters such as TAB.

-Peter
Jul 18 '05 #2

P: n/a
if i am going to do this, how should i continue:
how would i know the end of file?
table_data = open(filename, 'r')
table_data.readlines()
On Tue, 15 Mar 2005 23:37:50 -0500, Peter Hansen <pe***@engcorp.com> wrote:
jrlen balane wrote:
how would i read a tab delimited file? at the same time put what i
read in an array, say for example that i know that the file is an
array with column= 5 and row=unknown.


Use the "csv" module. Although that stands for "comma
separated values", it readily supports alternative
delimiters such as TAB.

-Peter
--
http://mail.python.org/mailman/listinfo/python-list

Jul 18 '05 #3

P: n/a
> Peter Hansen wrote:
jrlen balane wrote:
how would i read a tab delimited file? at the same time put what i
read in an array, say for example that i know that the file is an
array with column= 5 and row=unknown.
Use the "csv" module. Although that stands for "comma
separated values", it readily supports alternative
delimiters such as TAB.


jrlen balane top-posted: if i am going to do this, how should i continue:
how would i know the end of file?


Look at the examples in the docs:

http://docs.python.org/lib/node617.html

STeVe
Jul 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.