I want to read ONLY the fourth and fifth column of this text file
sample.txt
2012-01-01 09:00 San Jose Men's Clothing 214.05 Amex
2012-01-01 09:00 Fort Worth Women's Clothing 153.57 Visa
2012-01-01 09:00 San Diego Music 66.08 Cash
I am able to do this, but the format of the output isn't what I want.
output
Men's Clothing 214.05
Women's Clothing 153.57
Music 66.08
Desired output
Men's Clothing 214.05
Women's Clothing 153.57
Music 66.08
Here is my code (I used some formatting but it's still not giving me the desired output):
for line in open("sample.txt"):
strsales=line.split()[-2]
item=line.split('\t')[3]
itemsales=item+"{0:>33}".format(strsales)
print(itemsales)