This is similar to this question, except I would like to end up with a new BLF file instead of a .csv file. I am doing this to remove a corrupted object in the BLF file that keeps me from importing it into Vector's software. I imagine there is a way to directly pass the 'can.io.blf.BLFReader' class object generated by BLFReader directly to BLFWriter, but I am having trouble figuring out how. The example code below should help explain the functionality I would like to achieve:
import can
filename_in = "corrupted.blf"
log = can.io.BLFReader(filename_in)
filename_out = "cleaned.blf"
can.io.BLFWriter(filename_out,log)