Announcement

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

  • Import 4000 (old-version?) excel files?

    Dear All, I have about 4,000 files in excel (please see the attached files. In fact, there are some Chinese characters before the filename but are omitted after uploading), which cannot be directly imported into Stata (16.1). Any suggestions? Or, do I have to resave the excel files in newer version of excel so as to be imported into Stata?
    Note: The filenames are 离任高管[000001.SZ], 离任高管[000002.SZ], 离任高管[000004.SZ]。
    Attached Files
    Ho-Chuan (River) Huang
    Stata 19.0, MP(4)

  • #2
    By the way, the error message is:

    Click image for larger version

Name:	error.png
Views:	1
Size:	32.9 KB
ID:	1537644
    Ho-Chuan (River) Huang
    Stata 19.0, MP(4)

    Comment


    • #3
      I don't have a solution to your problem. But I have an observation: are you sure these are just old version Excel files? I tried to open one in Excel (I have an up-to-date Office 365) and it told me that the file was not readable. I am not certain of this, but I think that Excel itself retains the ability to read files going all the way back to its earliest version. This would suggest that these files are not merely old but are in some way corrupted. Have you been able to open any of them in Excel itself?

      Comment


      • #4
        Open with a text editor like Notepad++: they are XML files. When I rename to .xml and open with Excel, it works, albei with an error message.
        However, I'm not sure one can import xml files in Stata. You may try with Python, and if it works you can write a Stata/Python program to do the import from Stata, since you have Stata 16. Or try with Excel and some VBA, but you will have to figure out why there is this error message.

        Comment


        • #5
          Dear Clyde, Thanks for your reply. The files are downloaded from a popular database in China (file by file, or, company-by-company). Actually, I can open the file (albeit with an error message as indicated by Jean-Claude), and re-save it as an `xlsx' format (and probably rename the filename). However, I have to do that 4,000 times (In fact, a coauthored Ph.D. student will do that). I will post another related question using the re-saved files in another thread to see further help later on.
          Ho-Chuan (River) Huang
          Stata 19.0, MP(4)

          Comment


          • #6
            Dear Jean-Claude, Thanks for your suggestions. As I replied to Clyde above, I guess I have to do that file by file.
            Ho-Chuan (River) Huang
            Stata 19.0, MP(4)

            Comment

            Working...
            X