Well, the format that I see the csv file is something like this:
IMU, 487293681, 0.3007393, 0.114936, -0.04736611, -0.379998, 0.07098468, -13.61945, 0, 0, 47.6759, 1, 1
IMU2, 487293681, 0.2675287, 0.1225688, -0.05286679, -0.3815768, 0.1907908, -13.32735, 0, 0, 50.375, 1, 1
GPS, 487294117, 4, 408521000, 1919, 12, 0.78, 34.6714628, -118.3349373, 921.36, 20.62035, 359.6666, 2.96, 1
GPA, 487294117, 0.97, 0.98, 1.38, 0.52, 1, 487294
MAG, 487294266, 428, 210, 274, -115, 0, 1, 0, 0, 0, 1, 487294257
MAG2, 487294266, 306, 129, 354, 77, -135, 38, 0, 0, 0, 1, 487294259
ARSP, 487294315, 17.68646, 156.9075, 29.63, 156.9075, 101.5598, 1
BARO, 487294384, 67.95848, 91898.86, 49.00, -4.158154, 487294, 0
CURR, 487294444, 15.60016, 5.479106, 321.8991
POWR, 487294454, 5.212646, 5.793, 1
SONR, 487294505, 0, 0, 0, 0
IMU, 487293681, 0.3007393, 0.114936, -0.04736611, -0.379998, 0.07098468, -13.61945, 0, 0, 47.6759, 1, 1
IMU2, 487293681, 0.2675287, 0.1225688, -0.05286679, -0.3815768, 0.1907908, -13.32735, 0, 0, 50.375, 1, 1
GPS, 487294117, 4, 408521000, 1919, 12, 0.78, 34.6714628, -118.3349373, 921.36, 20.62035, 359.6666, 2.96, 1
GPA, 487294117, 0.97, 0.98, 1.38, 0.52, 1, 487294
As you can see IMU shows up every time there is a new data. I am very new to python so parsing this would be pretty hard for me. Usually I am use to data that is the same, for example IMU, will be all under one column.
Also I found another mavlogdump.py somewhere no idea where but the code looks like this. Not sure if this is the same As the one you linked.
#!/usr/bin/env python
'''
example program that dumps a Mavlink log file. The log file is
assumed to be in the format that qgroundcontrol uses, which consists
of a series of MAVLink packets, each with a 64 bit timestamp
header. The timestamp is in microseconds since 1970 (unix epoch)
'''
import sys, time, os
# allow import from the parent directory, where mavlink.py is
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
import mavutil
from optparse import OptionParser
parser = OptionParser("mavlogdump.py [options]")
parser.add_option("--no-timestamps",dest="notimestamps", action='store_true', help="Log doesn't have timestamps")
parser.add_option("--planner",dest="planner", action='store_true', help="use planner file format")
parser.add_option("--robust",dest="robust", action='store_true', help="Enable robust parsing (skip over bad data)")
parser.add_option("-f", "--follow",dest="follow", action='store_true', help="keep waiting for more data at end of file")
parser.add_option("--condition",dest="condition", default=None, help="select packets by condition")
(opts, args) = parser.parse_args()
if len(args) < 1:
print("Usage: mavlogdump.py [options] <LOGFILE>")
sys.exit(1)
filename = args[0]
mlog = mavutil.mavlink_connection(filename, planner_format=opts.planner,
notimestamps=opts.notimestamps,
robust_parsing=opts.robust)
while True:
m = mlog.recv_match(condition=opts.condition, blocking=opts.follow)
if m is None:
break
if opts.notimestamps:
print("%s" % m)
else:
print("%s.%02u: %s" % (
time.strftime("%Y-%m-%d %H:%M:%S",
time.localtime(m._timestamp)),
int(m._timestamp*100.0)%100, m))