由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - a quick question importing txt into SAS
相关主题
reading data into sas 问题求教SAS问题
请教一个SAS读中文数据库的问题##SAS, SOS!! Read a delimited file that has embedded delimiters in the data
help. txt 读入问题请教一个SAS数据input的问题
问个SAS 数据读入的问题怎么在EXCEL里把一个column的A/B分到两个column里?
修改再问:如何read multiple lines into one record and missing value at the same time in sashelp! 读CSV文件读得要崩溃了
help with reading a strange csv file into SAS小包子:怎么读一个文件中的两个不同的delimiters
请问SAS里的truncover和R里的什么语句等同?从yahoo finance下载数据,R or Python?
问一个数据分析的问题关于读数据紧急求助,包子答谢,谢谢了先
相关话题的讨论汇总
话题: sas话题: comma话题: txt话题: dsd话题: length
进入Statistics版参与讨论
1 (共1页)
p*****o
发帖数: 543
1
in my txt file, the delimitor is comma, and field enclosed in double quotes.
eg:
"Jack, Liu", "Lucy, Li", ...
when I imported into sas, I know how to use delimiter = ',', but how can i
handle the comma the double quotes? What option should I use for it?
Thanks a lot
k*******a
发帖数: 772
2
sds
p*****o
发帖数: 543
3
i only saw dsd before......
so would you mind telling me how to use it?
INFILE "test.txt" DLM=',' DSD MISSOVER FIRSTOBS=2 sds='"'---is it right?

【在 k*******a 的大作中提到】
: sds
k*******a
发帖数: 772
4
sorry, it's DSD, my bad memory :(
Maybe you also need to define the length for the variable of name (the
defaul length is only 8)

【在 p*****o 的大作中提到】
: i only saw dsd before......
: so would you mind telling me how to use it?
: INFILE "test.txt" DLM=',' DSD MISSOVER FIRSTOBS=2 sds='"'---is it right?

Y**********8
发帖数: 67
5
DSD does two things:
1) sets commma the default delimiter (so you don't need the delimiter option)
2) removes quotation marks from values (so the quotation marks will be
removed from the values, and comma in the quotation marks will appear as
part of the values )
you may need the length statement before the input statement
correct me if I am wrong

quotes.

【在 p*****o 的大作中提到】
: in my txt file, the delimitor is comma, and field enclosed in double quotes.
: eg:
: "Jack, Liu", "Lucy, Li", ...
: when I imported into sas, I know how to use delimiter = ',', but how can i
: handle the comma the double quotes? What option should I use for it?
: Thanks a lot

p*****o
发帖数: 543
6
Great. Thanks all.
BTW, I tried using length and without lenght, I guess both work since each
variable in my data has uniform length.
one more question, if i want to use length option, for "Liu, Lili", should I
definied as at least 9 or 9+2?
Thanks!

option)

【在 Y**********8 的大作中提到】
: DSD does two things:
: 1) sets commma the default delimiter (so you don't need the delimiter option)
: 2) removes quotation marks from values (so the quotation marks will be
: removed from the values, and comma in the quotation marks will appear as
: part of the values )
: you may need the length statement before the input statement
: correct me if I am wrong
:
: quotes.

p*****o
发帖数: 543
7
btw, i thought dsd also treated nothing btw two comma as a missing value?

option)

【在 Y**********8 的大作中提到】
: DSD does two things:
: 1) sets commma the default delimiter (so you don't need the delimiter option)
: 2) removes quotation marks from values (so the quotation marks will be
: removed from the values, and comma in the quotation marks will appear as
: part of the values )
: you may need the length statement before the input statement
: correct me if I am wrong
:
: quotes.

1 (共1页)
进入Statistics版参与讨论
相关主题
关于读数据紧急求助,包子答谢,谢谢了先修改再问:如何read multiple lines into one record and missing value at the same time in sas
SAS 问题求助 -- create new variablehelp with reading a strange csv file into SAS
[合集] 请问sas input的一个问题请问SAS里的truncover和R里的什么语句等同?
[合集] SAS data input help问一个数据分析的问题
reading data into sas 问题求教SAS问题
请教一个SAS读中文数据库的问题##SAS, SOS!! Read a delimited file that has embedded delimiters in the data
help. txt 读入问题请教一个SAS数据input的问题
问个SAS 数据读入的问题怎么在EXCEL里把一个column的A/B分到两个column里?
相关话题的讨论汇总
话题: sas话题: comma话题: txt话题: dsd话题: length