How to read the contents of an uploaded file?

So far, I am able to create an upload page where the user could upload a file. Now I want to store the contents of the file and I want to read the contents of the program, process the contents.

How can I do it? I am stuck at this point; please help. Here is what I have tried so far

import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
import dash_table

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']


# colors = {
#          'background': '#000000',
#          'color': '#ffffff'
# }

file_upload_style={
            'width': '99%',
            'height': '60px',
            'lineHeight': '60px',
            'borderWidth': '2px',
            'borderRadius': '1x',
            'textAlign': 'center',
            'margin': '10px'

        }


header_style={
    'textAlign' : 'center'
}

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)

app.layout = html.Div(children=[

    html.H1(children='Calculate per gene coverage',style=header_style),
    
    dcc.Upload(
        id='upload-data',
        children=html.H4([
            'Drag and Drop or ',
            html.A('Select Files')
        ]),
        style=file_upload_style,
        # Dont' allow multiple files to be uploaded
        multiple=False
    ),

    
    html.Div(id='output-data-upload'),
])

@app.callback(dash.dependencies.Output('output-data-upload', 'children'),
             [dash.dependencies.Input('upload-data', 'contents'),
              dash.dependencies.Input('upload-data', 'filename')])
def update_output(contents, filename):
    if contents is not None:
        children='You have uploaded: ' + filename
        return contents
    else:
        return 'Upload your file'


if __name__ == '__main__':
    app.run_server(debug=True)

do you have a specific file type you want to read.

for simple text and images refer to the Dash docs: https://dash.plot.ly/dash-core-components/upload

There will be 2 different uploads. Say , file#1 would be a tab separated file which contains say 3 columns like this

Tom 1 AAA
Harry 2 BBB
Dave 3 CCC

and file#2 will be a text file with only one column say

AAA
BBB

The idea is to take these 2 files as input and read through the files and do something , for example, filter file#1 based on enteries in file#2. In reality, I want to do many operations as the files will be complex. So, first I need to see how I can read through the files.