Extracting data using python

Question:

I have a text file like this

app galaxy store    Galaxy Store
app text editor Text Editor
app smartthings SmartThings
app samsung pay Samsung Pay
app pdssgentool PdssGenTool
app pdss-sample pdss-sample
app encodertool EncoderTool
app play store  Play Store
app play music  Play Music
app keep notes  Keep Notes

where the format is like

app(tab)name(tab)name_starting_with_caps

From here I only want to extract the name part and store it in a list. Can anyone help me how to do that in python. For example list=[galaxy store, text editor, ...]

Asked By: Mohan Singh

||

Answers:

Use csv.reader with delimiter='t':

import csv

with open('yourfile') as f:
    csv_reader = csv.reader(f, delimiter='t')
    names = [row[1] for row in csv_reader]
Answered By: RomanPerekhrest
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.