Advertisement
| 10.13.2008 at 12:29PM PDT, ID: 23810592 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: |
#!/usr/bin/python
import csv
fin = open('rawData.csv', 'rb')
source = csv.reader(fin, quoting=csv.QUOTE_NONNUMERIC)
fout_hr = open('hr_sorted.csv', 'wb')
hr_writer = csv.writer(fout_hr, quoting=csv.QUOTE_NONNUMERIC)
fout_min = open('min_sorted.csv', 'wb')
min_writer = csv.writer(fout_min, quoting=csv.QUOTE_NONNUMERIC)
status = 0 # wait for the header
header = None # collecting header lines of the section
writer = None # reference to the wanted output writer
for row in source:
if status == 0: # wait a section header rows
if row[0] == 'Point Name:':
header = [ row[1:] ] # the list with the info from the first header row
status = 1
else:
continue
elif status == 1: # collecting some header rows
if row[1] == '1 Minutes':
header.append(row)
writer = min_writer
elif row[1] == '60 Minutes':
header.append(row)
writer = hr_writer
elif row[1] == 'Date Range':
pass # Ignore this header row.
elif row[0] == 'Report Timings:':
# Ignore this header row. Do output the collected header.
for r in header:
writer.writerow(r)
status = 2 # Get ready for for the value rows.
elif status == 2: # collecting the values
if len(row) == 4: # detect the row with values
writer.writerow(row[0:3]) # output the first three columns only
else:
writer.writerow(['']) # separator
status = 0 # wait for another section
else:
print 'Unexpected status', status
fout_hr.close()
fout_min.close()
|
Advertisement