def MolReader(filename): atoms = [] with open(filename, "r") as molfile: for i in range(4): line = molfile.readline() na = int(line[0:3]) for i in range(na): line = molfile.readline() x = float(line[0:10]) y = float(line[10:20]) z = float(line[20:30]) symbol = line[31:34].strip() atoms.append([symbol,x,y,z]) print(atoms) data = MolReader("CID_85449051.mol")