I'm very new to Python and I know this is a pretty basic question. I have a text file with columns of data. I want to remove the columns and make it one long list.
I have the following code:
for line in open('feddocs_2011.txt', 'r'):
segmentedLine = line.split("/t")
print segmentedLine
This seems to create a separate string for each line, but I think I may need to loop through each of those new strings to split those next. I thought it would have put everything following a tab on a new line. I tried the following, but got an error message that "list" doesn't have a split function.
while segmentedLine:
item = segmentedLine.split("\t")
print item
Thanks very much for any input.