I need to write all the output CSV files to a different folder. For example if .pcap files were in subfolders Sub1, Sub2. And Sub1>
Call tshark, (something like this )
f_in = 'x.pcap'
f_out = 'x.csv'
tshark_template = 'tshark -r {} -T fields -e frame.number -e frame.time -e eth.src -e eth.dst -e ip.src -e ip.dst -e ip.proto -E header=y -E separator=, -E quote=d -E occurrence=f > {}'
final_tshark_cmd = tshark_template.format(f_in,f_out)
Build the command dynamically using python, so you can control the names of the files.
Each -e stands for a field that you want to be in the output.