Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Are there commands for importing/exporting OpenOffice/LibreOffice documents?

    A query has occurred to me. Are there any Stata commands (official or user-written) for importing and exporting OpenOffice or LibreOffice spreadsheet datasets to and from Stata? (Like import excel and export excel.)

    Best wishes

    Roger

  • #2
    Because these packages are freely available, the user having such files has the possibility to install the corresponding spreadsheet, open the data files, and resave them in Excel or CSV formats. Developing native readers makes more sense when the producing package may not be easily installed, such as in the cases of expensive software, or antique/obsolete data formats, for which no software is currently available.

    StatTransfer supports OpenDocument spreadsheets according to its list of supported formats:
    https://www.stattransfer.com/stattransfer/formats.html

    Best, Sergiy Radyakin

    Comment


    • #3
      Thanks to Sergiy for this. I think the Stat/Transfer route will probably be the way to go (using my own SSC package stcmd).

      My current problem is that I have an Excel file with 21 worksheets, and it would be ideal to mechanise the procedure for converting these to Stata, after converting the whole Excel file to OpenDocument. Of course, I can manually convert all these files to tab-delimited .txt versions one by one, and I have done this. However, if I am going to be working with more enormous multi-worksheet spreadsheets in future, then the ideal long-term non-Microsoft solution will probably involve Stat/Transfer.

      Best wishes

      Roger

      Comment


      • #4
        So why not import all 21 worksheets to Stata directly from your original Excel file?

        Code:
        import excel "C:\Users\Sergiy\Desktop\Demo.xlsx", sheet("alpha") firstrow clear
        import excel "C:\Users\Sergiy\Desktop\Demo.xlsx", sheet("beta") firstrow clear
        ...

        Comment


        • #5
          I was aware of import excel and export excel. However, now that I and my colleagues have started using Linux at least some of the time, I am trying to phase out all things Microsoft.

          Best wishes

          Roger

          Comment


          • #6
            However, now that I and my colleagues have started using Linux at least some of the time, I am trying to phase out all things Microsoft.
            Good luck with that! I attempted to do this a number of years back. It's only workable if your network of collaborators does the same. For better or for worse, Microsoft Office has a very strong penetration in most academic and commercial organizations. Even if you eschew their software, you will find that your collaborators send you Microsoft files, and will expect you to reciprocate. Yes, Open Office can read and write Microsoft Office formats, but I have found that the translations are very glitchy. Ultimately I found the burdens of dealing with that became more trouble than they're worth. I really wish you well in this endeavor, but I'll be very surprised if you can sustain it.

            Comment


            • #7
              +1 to Clyde's comment.
              I see rationale in switching to some alternative software, and staying with XLS/XLSX file formats.
              But switching the file format is an entirely different matter.
              Best, Sergiy

              Comment


              • #8
                I think I am trying to supersede Excel before I supersede MS Word. A spreadsheet is one or more sets of data. And data should be in a form that I can return to decades down the line, when Microsoft proprietary formats may be dust. And also in a form that will not be mangled by Microsoft proprietary spreadsheet software, which frequently changes data around without asking the user.

                Only a few months ago, I dusted off some anonymised exam marks from the 1990s for use as an example dataset for an unrefereed document about Bland-Altman analysis (Newson, 2016). It was reassuring (at least to me) that they were stored in a generic format.

                My current approach to MS Word is to produce my reproducible-research results as HTML (with graphics in Scalable Vector Graphics (.svg) format). My colleagues can then cut and paste these into Word and Powerpoint to produce more ephemeral documents.

                Best wishes

                Roger

                References

                Newson RB. Rank parameters for Bland-Altman plots. Published October 5, 2016. Downloadable as of today from
                http://www.imperial.ac.uk/nhli/r.new...eous_documents

                Comment

                Working...
                X