rostopic echo "topic_name" -b "bag_name" -p > "file.csv" e.g. rostopic echo /turtle1/pose -b bag1.bag -p > file.csv