2.0.103.2 (2023-04-27)
- Aspect ratio control in Options window changed from text box to list box including Full, 4:3, 3:2, 16:9 and 10-50 dB/dec.
#ChatGPT says this isn't elegant, and it's right.
import sys, csv
try:
droppedFile = sys.argv[1]
except IndexError:
print("No file dropped!!!")
start = 0
stop = "20000"
string = "RMS Level"
orientation = input("HOR, VER-, VER+?")
with open(droppedFile, 'r') as measurement_file:
reader = csv.reader(measurement_file, delimiter=';')
measurement_data = list(reader)
for i, v in enumerate(measurement_data):
if "Phase" in measurement_data[i]:
print("Phase starts at: " + str(i))
break
for rowampl, item in enumerate(measurement_data):
if rowampl > i:
print("should be done")
print(str(rowampl) + ">" + str(i))
break
if string in measurement_data[rowampl]:
print(str(start) + "0°")
fout = open("" + orientation + str(start) + "0.txt", "w")
rowphase = rowampl + i
start += 1
try:
while stop not in item[0]:
ampl = measurement_data[rowampl]
phase = measurement_data[rowphase]
fout.write(ampl[0] + ";" + ampl[1] + ";" + phase[1] + "\n")
rowampl += 1
item = measurement_data[rowampl]
rowphase = rowampl + i
ampl = measurement_data[rowampl]
phase = measurement_data[rowphase]
fout.write(ampl[0] + ";" + ampl[1] + ";" + phase[1] + "\n")
rowampl += 1
item = measurement_data[rowampl]
rowphase = rowampl + i
except StopIteration:
pass
. Unless if you want to.
Leave a comment: