I have a string that looks like this:
"2018-05-23-13:54:56.594000" When i try to convert it to int, it gives me an error:
ValueError: invalid literal for int() with base 10: '"2018-05-23-13:54:56.594000"' Code:
output_file = open(r"C:\PATH\123.acc.bin", "wb") with open(r"C:\PATH\00000007.csv", newline='') as csvfile: sensor = csv.reader(csvfile, delimiter=',', quotechar='|') with open(r"C:\PATH\3dm2.csv", newline='') as csvfile: sensor2 = csv.reader(csvfile, delimiter=',', quotechar='|') for row, row2 in zip(sensor, sensor2): internalTimestamp = int(row2[16]) msInfile = (int(float(row2[12])*1000)) + (1523138400000+604800000) accX = float(row[0]) accY = float(row[1]) accZ = float(row[2]) roll = float(row[3]) pitch = float(row[4]) yaw = float(row[5]) accData2 = pack('f', accX) accData3 = pack('f', accY) accData4 = pack('f', accZ) accData5 = pack('f', roll) accData6 = pack('f', pitch) accData7 = pack('f', yaw) accData8 = pack('I', internalTimestamp) accData9 = pack('I', ValidData) accData10 = pack('q', msInfile) output_file.write(accData2) output_file.write(accData3) output_file.write(accData4) output_file.write(accData5) output_file.write(accData6) output_file.write(accData7) output_file.write(accData8) output_file.write(accData9) output_file.write(accData10) count += 1 This is my code where I pack data from two different csv files into one binary file.
internalTimestamp = int("2018-05-23-13:54:56.594000")strptime()