You are currently viewing Organize media files quickly with our Stata command

If you’re a Stata and SurveyCTO user looking for a way to easily rename collected media files, we have good news! We’ve created a Stata command that will make it easier for you to organize the media attachments you collect, including images, audio, video, and text files, saving you time and enhancing the quality of your data.

This SurveyCTO resource for Stata users is significantly based on the work of a pre-existing resource created by Ishmail Azindoo Baako, Research Quality Coordinator at Innovations for Poverty Action (IPA). Both resources achieve the same aims, but the SurveyCTO version has been tailored for more general use, as opposed to the specific requirements of IPA projects.

What can this command do?

Let’s assume that you’re using the SurveyCTO audio audit feature in your household survey to better understand how your survey is being conducted in the field and ensure that the highest possible quality of data is being collected. For a large-scale survey, you’ll generate a significant number of audio files that can be time-consuming to categorize and archive. 

By running our new command, you’ll be able to automatically:

  • Create copies of the audio files in a specified folder with names constructed from values stored in your dataset. These values include the unique identifier of the households and enumerators, as well as any other values captured in your survey, such as the town and region.
  • Organize the above media files into sub-folders, also constructed from values in your dataset.
  • Add conditionality to perform these tasks for some but not all submissions. 

You’ll be able to use this command for all the media files you collect with SurveyCTO, including images, audio, video, and text audit files.

Where can I find this command?

The sctomedia command is included in the scto Stata package, where you can find other Stata commands, such as our command to analyze sensor data. All information and codes are available on our GitHub page. And you can refer to this support article for more guidance on how to install the package and use this command.

We hope that you find this command useful! Please share your experience in our user forum and with the Stata community!

Chris Robert


Chris is the founder of SurveyCTO. He now serves as Director and Founder Emeritus, supporting Dobility in a variety of part-time capacities. Over the course of Dobility’s first 10 years, he held several positions, including CEO, CTO, and Head of Product.

Before founding Dobility, he was involved in a long-term project to evaluate the impacts of microfinance in South India; developed online curriculum for a program to promote the use of evidence in policy-making in Pakistan and India; and taught statistics and policy analysis at the Harvard Kennedy School. Before that, he co-founded and helped grow an internet technology consultancy and led technology efforts for the top provider of software and hardware for multi-user bulletin board systems (the online systems most prominent before the Internet).