【发布时间】:2016-04-21 19:36:10
【问题描述】:
我不是程序员,也不是 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
我做错了什么?
【问题讨论】:
-
您好,当您从该自述文件中复制/粘贴命令时,不要包含初始的“$”。前面那个“$”符号只是表示它后面的都是终端命令。
-
感谢 Seemant - 成功了。当你知道怎么做时很容易!
-
不客气。这是关于那件事的精彩介绍:github.com/INFO-474/m1-terminal-and-git