楼主: rictan
10850 22

[数据管理求助] 急!怎样将大量单个excel的csv格式文件数据导入stata或eviews中,组成一个大文件? [推广有奖]

11
fgleric 发表于 2013-6-14 21:42:40
rictan 发表于 2013-6-14 01:05
我运行了,但是只能导入一个csv文件,不能实现一次导入多个文件啊?
不能一次导入多个
只能一个个导入然后append

12
hplcdadong 发表于 2013-6-14 22:07:23
rictan 发表于 2013-6-13 23:19
不好意思,我初学不太明白。能否具体说明呢?你建议是用stata做么?
mergeall is a user-written Stata command, you have to install it before you can use it. Type the following in your Stata "Command Window" :

findit mergeall

Follow the instructions to find and install it, then in the "Command Window", type the follow to know how to use it:

Help mergeall

13
rictan 发表于 2013-6-15 22:28:58
hplcdadong 发表于 2013-6-14 22:07
mergeall is a user-written Stata command, you have to install it before you can use it. Type the f ...
谢谢!

14
rictan 发表于 2013-6-15 22:40:51
蓝色 发表于 2013-6-14 01:19
根据fgleric 的程序改了一下
你的保证所有的数据结构都是一样的。
您好,非常谢谢您的回复。我试了一下您的程序后,文件夹里有18个文件,但只将其中7个导入了stata中,不知道什么问题呢?我在想,如果不能用的话应该都不行,怎会只完成一部分呢?我把相关结果上传在附件了,烦请您查看帮助!!!!非常感谢。

15
rictan 发表于 2013-6-15 22:42:19
运行结果,烦请帮忙!!

运行结果图.jpg (56.65 KB)

运行结果图.jpg

运行程序.txt
下载链接: https://bbs.pinggu.org/a-1351309.html

974 Bytes

16
蓝色 发表于 2013-6-15 23:09:44
没有数据
看不到那些不能转的数据是否有问题啊

我前面说了:你的保证你的数据结构都是相同的,都没有问题

17
rictan 发表于 2013-6-16 00:09:16
蓝色 发表于 2013-6-15 23:09
没有数据
看不到那些不能转的数据是否有问题啊
麻烦帮我看看吧,非常感谢啊!!!!!!!!!!!
我把数据传上来了!

18
rictan 发表于 2013-6-16 00:11:19
麻烦帮我看看啊。你说的数据结构什么意思?我把转换好的数据分开以后,再次处理剩下的也不能处理啊?请帮我看看吧,非常感谢!!!!如果方便的话能否邮件请教呢,我的邮箱是 ershibuyou@126.com

merge.zip

621.11 KB

19
hplcdadong 发表于 2013-6-16 11:53:37
It seems that each of your csv file does not have a unique id, so "mergeall" does not work. Here is another user-written command "csvconvert", I have tried on your data, it merges perfectly all you 18 csv into one Stata dta file (output.dta)

Assume that all your csv files are located at : C:\Users\guest1\Downloads\merge3, after installing this command, just type:

clear
csvconvert C:\Users\guest1\Downloads\merge3

You are done! Good luck

20
蓝色 发表于 2013-6-16 11:59:39
rictan 发表于 2013-6-16 00:11
麻烦帮我看看啊。你说的数据结构什么意思?我把转换好的数据分开以后,再次处理剩下的也不能处理啊?请帮我 ...
你的有几个csv文件的名字和. 直接有空格,导致读取的时候不识别
所以说要求你的文件都需要一直
你把那几个有空格的手动改了就可以了

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

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