csv-convert: Fix syntax issues.

Tested this against a newly created .csv, seems to work.

Signed-off-by: Ben Greear <greearb@candelatech.com>
This commit is contained in:
Ben Greear
2021-05-11 06:23:33 -07:00
parent 754207e623
commit 894e64e3d3

View File

@@ -58,7 +58,7 @@ class CSVParcer():
cni += 1
# Write out out header for the new file.
fpo.write("Test Run,Position [Deg],Attenuation 1 [dB],Pal Stats Endpoint 1 Control Rssi [dBm],Pal Stats Endpoint 1 Data Rssi [dBm]")
fpo.write("Test Run,Position [Deg],Attenuation 1 [dB],Pal Stats Endpoint 1 Control Rssi [dBm],Pal Stats Endpoint 1 Data Rssi [dBm]\n")
# Read rest of the input lines, processing one at a time. Covert the columns as
# needed, and write out new data to the output file.
@@ -71,7 +71,9 @@ class CSVParcer():
step_i = 0
while line:
x = line.split(",")
fpo.write("%s,%s,%s,%s\n" % (test_run, x[i_rotation], x[i_atten], x[i_beacon_rssi], x[i_data_rssi]))
#print(x)
#print([test_run, x[i_rotation], x[i_atten], x[i_beacon_rssi], x[i_data_rssi]])
fpo.write("%s,%s,%s,%s,%s" % (test_run, x[i_rotation], x[i_atten], x[i_beacon_rssi], x[i_data_rssi]))
bottom_half += ("%s,%s,%s,%s\n" % (step_i, x[i_rotation], x[i_atten], x[i_rxbps]))
line = fp.readline()
step_i += 1