我尝试在我的C#winform程序中将csv文件导入我的数据库.
例如csv文件:
code ,name ,price
101010,computer,200$
Run Code Online (Sandbox Code Playgroud)
我这样做了:
char[] BI = { ',' };
string[] WI = TEMP.Split(BI);
A = WI[0].Trim().ToString();
B = WI[1].Trim().ToString();
C = WI[2].Trim().ToString();
Run Code Online (Sandbox Code Playgroud)
但如果名称包含(,),我该怎么办?
例如
code ,name ,price
101010,computer 12,200.00,200$
Run Code Online (Sandbox Code Playgroud)
如果我得到这种类型的csv:
code ,name ,price
"101010","computer 12,200.00","200$"
Run Code Online (Sandbox Code Playgroud)
怎么处理这个?
| 归档时间: |
|
| 查看次数: |
706 次 |
| 最近记录: |