回答編集履歴
4
修正
test
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
```C#
|
16
16
|
|
17
|
-
public Record
|
17
|
+
public Record(string line)
|
18
18
|
|
19
19
|
{
|
20
20
|
|
@@ -38,7 +38,7 @@
|
|
38
38
|
|
39
39
|
{
|
40
40
|
|
41
|
-
return lines.Select(a => new Record
|
41
|
+
return lines.Select(a => new Record(a));
|
42
42
|
|
43
43
|
}
|
44
44
|
|
3
修正
test
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
```C#
|
16
16
|
|
17
|
-
public Re
|
17
|
+
public RecordCsv(string line)
|
18
18
|
|
19
19
|
{
|
20
20
|
|
2
修正
test
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
{
|
20
20
|
|
21
|
-
// TODO: 文字列を解析してフィールドに代入する処理
|
21
|
+
// TODO: 文字列を解析してプロパティ・フィールドに代入する処理
|
22
22
|
|
23
23
|
}
|
24
24
|
|
1
追記
test
CHANGED
@@ -1,3 +1,45 @@
|
|
1
1
|
オーバーロードされた ReadCsv があるんじゃないでしょうか?
|
2
2
|
|
3
3
|
あまりに不完全すぎてそりゃコンパイル通る訳がないと思うソースですが、これで全文ですか?
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
追記
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
要するにこれの一部じゃないかということです。
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
```C#
|
16
|
+
|
17
|
+
public ReadCsv(string line)
|
18
|
+
|
19
|
+
{
|
20
|
+
|
21
|
+
// TODO: 文字列を解析してフィールドに代入する処理
|
22
|
+
|
23
|
+
}
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
public static IEnumerable<Record> ReadCsv(string path)
|
28
|
+
|
29
|
+
{
|
30
|
+
|
31
|
+
return ReadCsv(File.ReadLines(path));
|
32
|
+
|
33
|
+
}
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
public static IEnumerable<Record> ReadCsv(IEnumerable<string> lines)
|
38
|
+
|
39
|
+
{
|
40
|
+
|
41
|
+
return lines.Select(a => new RecordCsv(a));
|
42
|
+
|
43
|
+
}
|
44
|
+
|
45
|
+
```
|