What Is a DO File?

How to open, edit, & convert DO files

What to Know

  • A DO file is most likely a Java Servlet file.
  • Open one with Apache Tomcat.
  • Convert to similar formats with that same program.

This article explains what a DO file is, how to open one, and how to convert one to a different format that might be easier to use in the program of your choice.

What Is a DO File?

A file with the .DO file extension could be a Java Servlet file. It's used by Java web servers to deliver web-based Java applications.

Other DO files are most likely Stata Batch Analysis files. These are usually called do-files and are plain text files that contain a list of commands that are to be executed together in a series.

Similar to Stata files is the ModelSim macro file format that uses this same file extension. Those kinds of files store macro-related commands used with Libero SoC.

DO files used with Notepad in Windows 11

Others might be files that have simply been misnamed as DO files but actually exist in an entirely different file format. These are usually PDFs downloaded from a website that, for one reason or another, were incorrectly given the wrong file extension.

dofile is also a function used when compiling and executing Lua programming code, but it isn't related to the file extension described on this page. It's also a loop command used with batch files. DO is an acronym as well, standing for domain object, digital output, digital order, data operation, data only, and device object.

How to Open a DO File

If it's a Java Servlet file, you should be able to open the DO file with Apache Tomcat, or possibly Apache Struts.

Stata Batch Analysis files only work within the context of a computer that's running Stata. One option for actually using the file within Stata is to enter do, followed by the file name in the Stata command window. For example, do myfile.

You can use the included Stata Do-File Editor to read and edit the commands, but any web browser can also be used to view the commands, and a text editor like Notepad++ can view and edit the DO file. The Stata editor is also useful for executing the file; just select Execute do file.

See this PDF on creating Stata do-files if you need help. There's more information available from Stata's website, too.

ModelSim DO files are used with Mentor Graphics ModelSim, which is included in the Libero SoC program suite. These are also plain text files that can be viewed and edited with any text editor program.

If you suspect that your file shouldn't be a DO file and is, in fact, a document, like a bank statement or some sort of insurance-related document, just rename it to end as .PDF, and see if it opens with a PDF reader like SumatraPDF, Adobe Reader, or one of these free options.

How to Convert DO Files

If a Java Servlet file is able to be converted to any other format, it's most likely done through the Apache programs mentioned above. Open the file in the application and look for some kind of Save as or Export menu that will let you save the DO file to another file format.

Stata Batch Analysis files can surely be converted to other text-based formats like TXT, but it's only useful if you want to read through the commands. If you do end up changing the file format it's in (to something like TXT), and you still want to run the commands with Stata, you have to specify the file extension in the command (e.g., do myfile.txt instead of do myfile, which assumes the DO suffix).

The same is true for ModelSim DO files; try using the menu within Libero SoC to convert the file or plug the macro's text into a text editor and save it to a new text-based format there.

If your file has been mistakenly given the .DO file extension but should really have the .PDF ending, you don't have to worry about a conversion. Instead, just rename .DO to .PDF so that your PDF reader will recognize the file.

Renaming like this isn't how file conversions work, but it does work in this scenario since the PDF shouldn't have been using the DO file extension anyway. File converter tools are used for true file conversions.

Still Can't Open It?

The most obvious reason for why a file won't open with the programs mentioned above is that it's not actually in any of these file formats. Double-check that the file extension reads ".DO" and not something similar like OD, SO, DOCX, DOC, DOP, DM, etc.

Those other file extensions, or any other one, belong to file formats that are unrelated to any of the formats mentioned here, which is why they won't open with the same software.

If you have one of those files instead, follow those links or research the file extension for more information about how opening or converting works.

Was this page helpful?