def read_trial_meta(trial_meta):
    """Opens trial_meta file and read line by line."""
    files_raw = []
    addftolist = False
    with open(trial_meta, 'r') as f:
        line = f.readline()
        while line:
            if 'acquisition_date' in line:
                acquisition_date = line.replace('acquisition_date', ''
                    ).replace('=', '').strip()
            if 'sample_time' in line:
                aux = line.replace('sample_time', '').replace('=', '').replace(
                    'msec', '').strip()
                sample_time = float(aux) / 1000.0
                sample_rate = 1 / sample_time
            if 'page_frames' in line:
                aux = line.replace('page_frames', '').replace('=', '').strip()
                n_frames = int(aux)
            if addftolist:
                files_raw.append(line.strip())
            if 'Data-File-List' in line:
                addftolist = True
            line = f.readline()
    file_rsm = files_raw[0]
    files_raw = files_raw[1:]
    return file_rsm, files_raw, acquisition_date, sample_rate, n_frames
