将csv文件转换为flare.json时出现问题

时间:2016-04-21 19:36:10

标签: java json bash csv d3.js

我不是Java的程序员和新手。我已经搜索了一种将csv转换为flare.json的方法,以便在D3.js数据可视化中使用。这里找到了最简单的方法

https://github.com/albertchang/CSV-to-flare.json-D3-parser/blob/master/readme.md

我尝试了但是在命令行中继续收到错误消息(Mac OS X El Capitan上的终端):

command not found.  Java and javac programmes all present and correct with recent versions.

这是位于D3_projects子文件夹中的Screenshot of working directory

以下是csv文件的前几行

Type,CA1,CA2,CA3,CA4
Customer,Sales and Marketing,Marketing,Market Research,

Customer,Sales and Marketing,Marketing,Marketing Communications,
Customer,Sales and Marketing,Marketing,Pricing,
Customer,Sales and Marketing,Sales,Sales Planning and Forecasting,
Customer,Sales and Marketing,Sales,Customer Segmentation,
Customer,Sales and Marketing,Sales,Customer Acquisition,Opportunity Management

工作目录中有一个空的flare.json文件(我也尝试运行没有空文件的程序)。

以下是我添加到终端的内容和错误消息的副本

Last login: Thu Apr 21 19:40:19 on ttys000
You have mail.
Rics-MacBook-Pro:~ ric$ cd /Users/ric/Documents/D3_Projects
Rics-MacBook-Pro:D3_Projects ric$ $ javac -cp json-simple-1.1.1.jar D3Taxonomy.java $ java -cp json-simple-1.1.1.jar: D3Taxonomy taxonomy_CA.csv " , "
-bash: $: command not found
Rics-MacBook-Pro:D3_Projects ric$ $ javac -cp json-simple-1.1.1.jar D3Taxonomy.java $ java -cp json-simple-1.1.1.jar: D3Taxonomy CA.csv " , "
-bash: $: command not found

正如您所看到的,我尝试了各种排列但仍然遇到同样的错误

$: command not found

我做错了什么?

1 个答案:

答案 0 :(得分:0)

回答 @Seemant Kulleen

只是为了关闭这个Q.

所以错误是当你复制代码时,你从命令中的终端留下$符号。

相关问题