質問編集履歴
2
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -38,6 +38,14 @@
|
|
38
38
|
|
39
39
|
|
40
40
|
|
41
|
+
#求める形
|
42
|
+
|
43
|
+
# date,id,name,address,sports
|
44
|
+
|
45
|
+
# 1,1,tanaka,tokyo,soccer
|
46
|
+
|
47
|
+
# 1,2,iguchi,kagoshima,baseball
|
48
|
+
|
41
49
|
|
42
50
|
|
43
51
|
```
|
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,11 +14,21 @@
|
|
14
14
|
|
15
15
|
tbl = CSV.table('sample1.csv', headers: true)
|
16
16
|
|
17
|
+
#sample1.csv
|
18
|
+
|
19
|
+
# date,id,name,address
|
20
|
+
|
21
|
+
# 1,1,tanaka,tokyo
|
22
|
+
|
23
|
+
# 1,2,iguchi,kagoshima
|
24
|
+
|
25
|
+
|
26
|
+
|
17
27
|
tbl.by_col!
|
18
28
|
|
19
29
|
|
20
30
|
|
21
|
-
#
|
31
|
+
#"sports"カラムを追加(値は"soccer",""baseball")
|
22
32
|
|
23
33
|
add_arr = ["sports", "soccer","baseball"]
|
24
34
|
|