#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 17 16:24:09 2016
@author: asdf
@Matrikelnummer: 1525911
@Seminar: Wissenschaftliches Programmieren in Python
"""
import numpy as np
mypath= 'imsil_out'
from os import listdir
onlyfiles= [f for f in listdir(mypath) if f.endswith('.out')] #suche datein mit der Endung .out im ordner mypath
#print('filelist: ',onlyfiles)
"""for daten in i:
i=i+1
i=0"""
tiltliste=onlyfiles
yieldliste = onlyfiles
laenge = len(onlyfiles)-1
i=0
while i <=laenge:
file = mypath+'/'+onlyfiles[i]
searchfile = open(file, "r")
for line in searchfile:
if "tilt=" in line:
# print (line)
auslesen = line
sss=auslesen[18:23]
if " | Backscattered |" in line:
zweilesen = line
# print(zweilesen)
searchfile.close()
# print(line)
liste[i]=auslesen[18:23]
yieldliste[i]=zweilesen[35:40]
#print(auslesen[18:23])
if i > 13:
break
i=i+1
print('tilt list:',liste)
print('yield field', yieldliste)
#print(auslesen[18:23])
#print(f)