-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCsv.cs
49 lines (44 loc) · 1.26 KB
/
Csv.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace RASDK.Basic.TestForms
{
public partial class Csv : Form
{
public Csv()
{
InitializeComponent();
}
private void buttonRead_Click(object sender, EventArgs e)
{
var csv = Basic.Csv.Read(textBoxPath.Text);
labelReadedFile.Text = string.Empty;
foreach (var r in csv)
{
string row = "";
foreach (var c in r)
{
row += c;
}
labelReadedFile.Text += row + "\r\n";
}
}
private void buttonWriteFile_Click(object sender, EventArgs e)
{
var data = new List<List<string>>
{
new List<string> { "11", "12", "13" },
new List<string> { "21", "22", "32" },
new List<string> { "3 1", "3,2", "3\r\n2" }
};
var colName = new List<string> { "A", "B", "C" };
Basic.Csv.Write(textBoxPath.Text, data, colName);
}
}
}