Using several tools at once for a project


Hi, this is my first post and I have recently started learing Data Science.
From all the discussions I here, I see people using R for cleaning up data then applying regression using python or vice versa or using perl for string analysis.
SO how really you go about writing a piece of code in R and then another in Python and how do you merge everything.


Take file -> Import in R -> Data Cleaning (or any other stuff) -> Export file -> Import file in Python -> Do things -> Export results