# -*- coding: utf-8 -*-
"""
@author: Kanazawa
"""
import csv

def ReadChromatos(chromatoPath, compoundID):
    compoundIDInput = str(compoundID).strip('(output)')

    f = open(chromatoPath, 'r')
    tsv = csv.reader(f, delimiter = '\t')

    row = next(tsv)
    while 0 == len(row) or str(row[0]).strip(" (input)") != compoundIDInput:
        row = next(tsv)
    next(tsv)
    row = next(tsv)

    n = []
    chromato = []
    for row in tsv:
        if(0 == len(row)):
            break
        n.append(float(row[0]))
        chromato.append(float(row[1]))
    return n, chromato