weka csv to arff特殊字符caue错误 [英] Weka csv to arff special characters caue error

查看:469
本文介绍了weka csv to arff特殊字符caue错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始接触Weka,并且无法将包含Tweets的CSV文件转换为Arff文件。

I'm new to Weka and having problems converting a CSV file containing Tweets into an Arff file.

Tweet,Class
Conference Update: 50% Off Registration to End .. http://t.co/nZtkSzZnJ6,Yes



< hr>

当我尝试使用Explorer转换为.arff时,我收到以下错误
...无法识别为CSV数据文件原因:错误的值数。读取1预期2,读取令牌[EOF],第2行


When I try to convert to .arff using Explorer, I receive the following error "...not recognized as an CSV data files Reason: wrong number of values. Read 1 expected 2, read token[EOF], line 2"

删除%字符允许文件无错误地转换为arff。我可以删除%和其他字符,但我真的不想改变我的Tweet数据。用单引号或双引号括起来也没有帮助。任何想法我做错了什么?

Removing the "%" character allows the file to convert to arff without error. I could remove "%" and other characters but I really don't want to alter my Tweet data. Enclosing in single or double quotes does not help either. Any idea what I am doing wrong?

欣赏任何帮助

推荐答案

Weka可以用%作为注释的开始,并忽略%和该行的其余部分。

Weka may interprete "%" as a begining of comment, and may ignore "%" and rest of that line.

请将整个字段

例如:
一个csv文件,其中内容

For Example: A csv file which contents following two lines, may be able to convert to Arff file by Weka.

Tweet,Class
会议更新:50%Off注册到结束..

Tweet,Class "Conference Update: 50% Off Registration to End .. http://t.co/nZtkSzZnJ6",Yes

PS $ b $对我有用[0]丢个板砖[0]引用|举报|编辑删除管理回复次数:0 |举报|字号大中小订阅用微信扫一扫将文章分享到朋友圈。作为转义字符,因此\使注释分隔符%变为正常字符%。

P.S. I'm sorry that my previous answer is incorrect. PRIVIOUS ANSWER (Incorrect answer) was: Try to replace "%" character to "\%". "\" works as escape character, so "\" makes the comment-delimiter character "%" to a normal character "%".

这篇关于weka csv to arff特殊字符caue错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆