Hi,
Have a csv-file with time as heading for each column and first column with depth and temperature inbetween. n*m table, or plot. I'm having problems reading the csv file:
fname = r'C:\Users\Desktop\Temperature.csv'
T1 = '15.08.2012 16:09:10'
T2 = '15.08.2012 19:22:57'
initial = time.mktime(time.strptime(T1, "%d.%m.%Y %H:%M:%S"))
final = time.mktime(time.strptime(T2, "%d.%m.%Y %H:%M:%S"))
r = csv.reader(open(fname))
timelist = r.next()
#datafile = open(fname, 'r').readlines()
time_out = open('C:\Users\Desktop\outfile.csv', 'w')
time_list = []
for i in range(1,len(timelist)):
timedate = timelist.split(';')
time_date = time.mktime(time.strptime(timedate[i], "%d.%m.%Y %H:%M:%S"))
if initial <= time_date <= final:
time_list.append(timedate)
#time_out.write(timedate)
print time_date
But the length of the timelist is 1. I am a beginner in csv file reading:(
What I want to do is decide which time intervall to be choosen, then i want it to be saved in lists.
The data looks like this:
Depth (m);15.08.2012 15:39:09;15.08.2012 16:09:10;15.08.2012 16:39:10;15.08.2012 16:43:36;15.08.2012 16:55:23;52.865;51.202;51.59;51.888;51.124;51.488;50.731;51.795;51.003;50.654;51.815;51.305;51.231;50.694;52.58 etc
So when you open it in excel:
Depth(m) 15.08.2012 15:39:09 15.08.2012 16:09:10 15.08.2012 16:39:10 etc
0 45.2323 32.332 23.233 ..........
1 .
2 .
3 .
4 etc
5
.
.
.**
Help please!:P