楼主: Imasasor
10271 14

导入csv出错,Unable to sample external file, no data in first 5 records. [推广有奖]

  • 1关注
  • 64粉丝

VIP

已卖:215份资源

学科带头人

33%

还不是VIP/贵宾

-

TA的文库  其他...

超哥喜欢的文章

威望
1
论坛币
47033 个
通用积分
3.1376
学术水平
238 点
热心指数
246 点
信用等级
231 点
经验
37132 点
帖子
849
精华
3
在线时间
2235 小时
注册时间
2012-7-4
最后登录
2024-10-10

初级学术勋章 初级热心勋章 初级信用勋章 中级热心勋章 中级学术勋章

楼主
Imasasor 发表于 2013-7-24 23:41:47 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
103000382 21-3-2013 12h20.rar (538 Bytes) 本附件包括:
  • 103000382 21-3-2013 12h20.csv



我有一个csv文件,不管用import procedure还是 import wizard导入都出错
日志提示:Unable to sample external file, no data in first 5 records.

源文件见附件,用写字板打开乱码,因此怀疑不是csv

扩展名改成xls,导入仍出错,也不是excel

当然, 另存为后就可以导入

问题是,我有几千个这样的文件,不可能一个个打开另存为

所以还是得靠代码写宏程序完成

求高手看看,我这个文件怎么才能导入。



二维码

扫码加我 拉你入群

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

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

关键词:External RECORDS Record Sample unable procedure records import file

欢迎加入亚太地区第一R&Python数据挖掘群: 251548215;

沙发
yongyitian 发表于 2013-7-25 00:41:02
Your file seems to be Dbase 3 data file.
Try to change your file extension to .dbf, then import it using proc import.

I have changed the filename in the following code.

PROC IMPORT OUT= WORK.SAMPLE
     DATAFILE= "F:\Temp\In\Sample130724.dbf"
     DBMS=DBF REPLACE;
     GETDELETED=NO;
RUN;
已有 2 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
Imasasor + 100 + 100 + 4 + 4 + 4 热心帮助其他会员
ziyenano + 3 + 3 + 3 精彩帖子

总评分: 经验 + 100  论坛币 + 100  学术水平 + 7  热心指数 + 7  信用等级 + 7   查看全部评分

藤椅
Imasasor 发表于 2013-7-25 09:20:15
yongyitian 发表于 2013-7-25 00:41
Your file seems to be Dbase 3 data file.
Try to change your file extension to .dbf, then import it ...
哥太牛了,请问哥,你是怎么确定它的文件类型的?
欢迎加入亚太地区第一R&Python数据挖掘群: 251548215;

板凳
yongyitian 发表于 2013-7-25 09:29:58
Imasasor 发表于 2013-7-25 09:20
哥太牛了,请问哥,你是怎么确定它的文件类型的?
at here

http://www.checkfiletype.com/upload-and-check
已有 1 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
webgu + 40 + 40 + 1 + 1 + 1 不错不错啊。

总评分: 经验 + 40  论坛币 + 40  学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

报纸
playmore 发表于 2013-7-25 09:30:00
yongyitian 发表于 2013-7-25 00:41
Your file seems to be Dbase 3 data file.
Try to change your file extension to .dbf, then import it ...
支持ls,自己完全不懂
DBase,好老的东西了,不知道还有人用没
playmore邀请您访问ChinaTeX论坛!!!进入ChinaTeX论坛

地板
yongyitian 发表于 2013-7-25 09:43:26
playmore 发表于 2013-7-25 09:30
支持ls,自己完全不懂
DBase,好老的东西了,不知道还有人用没
同意, 好象很少听说道, 查了一下。好象最新版是 dBASE PLUS 8.

7
Imasasor 发表于 2013-7-25 09:56:21
yongyitian 发表于 2013-7-25 09:29
at here

http://www.checkfiletype.com/upload-and-check
这个东西太牛了,试了几个,解析文件类型,牛的
欢迎加入亚太地区第一R&Python数据挖掘群: 251548215;

8
yongyitian 发表于 2013-7-25 09:59:52
Imasasor 发表于 2013-7-25 09:56
这个东西太牛了,试了几个,解析文件类型,牛的
By the way,
to change all the files extension.   
Go to the file folder in command window

Type xcopy *.csv *.dbf   -> enter        /* for make a copy */
Type rename *.csv *.dbf   -> enter     /* for rename the files */

9
影子癖 发表于 2013-7-26 16:26:10
强大~~

10
henryyhl 发表于 2013-7-26 22:32:24
嗯。学习了。呵呵、thanks
It's not going to be easy, but it is going to be worth it.

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-26 11:12