楼主: gainend
3204 9

excel的导入问题 [推广有奖]

  • 0关注
  • 2粉丝

教授

18%

还不是VIP/贵宾

-

威望
0
论坛币
27351 个
通用积分
0.3765
学术水平
3 点
热心指数
3 点
信用等级
0 点
经验
15858 点
帖子
341
精华
0
在线时间
2062 小时
注册时间
2009-12-13
最后登录
2025-10-13

楼主
gainend 发表于 2012-10-16 21:27:01 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
我用xmluse调用已经另存为.xml的excel文件,为何显示找不到文件?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:EXCEL exce xcel cel XML excel

沙发
dfgerry 在职认证  发表于 2012-10-16 21:34:20
在设置里面看存储路径

藤椅
gainend 发表于 2012-10-17 08:39:48
怎么看啊?

板凳
大白菜2012 发表于 2012-10-17 08:54:32
显示当前读取存储路径

cd

save和read同一个文件,都应当在共同的路径下

help cd
元芳,侬怎么L00K?

报纸
gainend 发表于 2012-10-17 09:12:05
我的文件已经在按xml格式在桌面,请您仔细说怎么操作读进去文件。

地板
大白菜2012 发表于 2012-10-17 09:25:08
gainend 发表于 2012-10-17 09:12
我的文件已经在按xml格式在桌面,请您仔细说怎么操作读进去文件。
我有个习惯,在stata程序的最开始,都设置好工作folder。
比如,
cd "c:\work\project1\data\"

在之后的程序里, save data1就是把data1数据包存储在路径下,c:\work\project1\data\
use data1,就是直接读取在同一路径下的data1数据包。


像你现在已经把数据放在桌面,假设你桌面的路径是"c:\work\desktop\"
你可以这样读,
use "c:\work\desktop\data1",clear

或者
cd "c:\work\desktop\"
use data1, clear
元芳,侬怎么L00K?

7
大白菜2012 发表于 2012-10-17 09:29:55
gainend 发表于 2012-10-17 09:12
我的文件已经在按xml格式在桌面,请您仔细说怎么操作读进去文件。
忘了你是要读xml

xmluse "c:\work\desktop\data1",clear doctype(excel)


see this,
Assuming that we have a file named auto.xml that was saved using the
    doctype(dta) option of xmlsave, we can read in this dataset with the
    command

        . xmluse auto, doctype(dta) clear

    If the file was saved from Microsoft Excel to a file called auto.xml that
    contained the worksheet Rollover Data, with the first row representing
    column headers (or variable names), we could import the worksheet by
    typing

        . xmluse auto, doctype(excel) sheet("Rollover Data") firstrow clear

    Continuing with the previous example, if we wanted just the first column
    of data in that worksheet, and we knew there were only 75 rows, including
    one for the variable name, we could have typed

        . xmluse auto, doc(excel) sheet("Rollover Data") cells(A1:A75) first
            clear

元芳,侬怎么L00K?

8
gainend 发表于 2012-10-17 09:52:59

. xmluse "C:\Documents and Settings\Administrator.ADMIN-C3CB4DFC8\桌面\stata11\瑞斯2.xls ", clear doctype(excel)
file C:\Documents and Settings\Administrator.ADMIN-C3CB4DFC8\桌面\stata11\瑞斯2.xls not found
上面是命令,下面是软件的结果,还是不能解决

9
大白菜2012 发表于 2012-10-17 09:57:23
gainend 发表于 2012-10-17 09:52
. xmluse "C:\Documents and Settings\Administrator.ADMIN-C3CB4DFC8\桌面\stata11\瑞斯2.xls ", clear  ...
在excel里,先把xls转换成xml
元芳,侬怎么L00K?

10
superhukai2013 发表于 2012-10-17 22:06:57
非常感谢

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-27 06:57