CSVファイルからソートデータを読み込もうとしていますが、長い文字列に問題があります。私はSASからの私の出力の一部と元のデータセットのスクリーンショットを添付しました。 (データセットはKaggleのTed Talksのものです)SAS CSV parse長い文字列
変数 "tags"に問題があります。基本的には、タグを読み込んでそれに応じてデータを並べ替えることを目指しています(子供や教育に言及するタグは教育カテゴリに入れます)。これまでのところ、私はちょうどそれらを読んでいるだけで固まっています。どんな助けもありがとう!
これは、これまでの私のコードです:CSVデータの
data tedtalks;
infile 'O:\ted_main1.csv' dlm = ',' firstobs = 2;
informat name $80.;
informat main_speaker $20.;
informat speaker_occupation $60.;
informat title $80.;
input comments duration event $ film_date languages
main_speaker $ name $ num_speaker published_date
speaker_occupation $ tags $ title $ views
;
run;
proc print data=tedtalks;
run;
最初の数行:
comments duration event film_date languages main_speaker name num_speaker published_date speaker_occupation tags title views
4553 1164 TED2006 1140825600 60 Ken Robinson Ken Robinson: Do schools kill creativity? 1 1151367060 Author/educator ['children', 'creativity', 'culture', 'dance', 'education', 'parenting', 'teaching'] Do schools kill creativity? 47227110
265 977 TED2006 1140825600 43 Al Gore Al Gore: Averting the climate crisis 1 1151367060 Climate advocate ['alternative energy', 'cars', 'climate change', 'culture', 'environment', 'global issues', 'science', 'sustainability', 'technology'] Averting the climate crisis 3200520
124 1286 TED2006 1140739200 26 David Pogue David Pogue: Simplicity sells 1 1151367060 Technology columnist ['computers', 'entertainment', 'interface design', 'media', 'music', 'performance', 'simplicity', 'software', 'technology'] Simplicity sells 1636292
200 1116 TED2006 1140912000 35 Majora Carter Majora Carter: Greening the ghetto 1 1151367060 Activist for environmental justice ['MacArthur grant', 'activism', 'business', 'cities', 'environment', 'green', 'inequality', 'politics', 'pollution'] Greening the ghetto 1697550
ExcelにインポートされたCSVデータの画像を見ることは役に立ちません。あなたの質問にCSVデータのいくつかの行を貼り付けることをお勧めします。コードとしてフォーマットされています。 – Quentin
コンマ区切りのファイルのように見えません。おそらくそれらの値の間のTABS? – Tom
何らかの理由で、ExcelでCSVを開くと、カンマが表示されません。カンマはそこにある。私がメモ帳で開くと、突然それが表示されます。 * shrugs * –