如何跳过csv文件中的第一行 [英] how to skip the first line in csv file
问题描述
大家好
我有一个带标头的csv文件...我不想要该标头,因为我将从第二行检查数据类型和其他验证
i have a csv file with header...i dont want to that header as i will be checking the datatype and other validations from the second line
喜欢
字符串<//span> lStrLine = aReader.ReadLine(); 如果 (lStrLine
== 空 )
:Consolas; color:blue; font-size:10pt>
<-size:10pt> (lStrLine.Trim()
== "" )
:Consolas; color:blue; font-size:10pt> 继续 ; 字符串 []
lArrStrCells = 空 ;
lArrStrCells = lStrLine.Split( '|' );
如果 (nArrStrCells
== 空 )
:Consolas; color:blue; font-size:10pt> 继续 ;
string<//span> lStrLine = aReader.ReadLine();
if (lStrLine
== null)
break;
if (lStrLine.Trim()
== "")
continue;
string[]
lArrStrCells = null;
lArrStrCells = lStrLine.Split('|');
if (lArrStrCells
== null)
continue;
跨度>
专栏..但对于标题,我什么也不会做..我只想略过.请帮助......
推荐答案
由于您似乎不想讨论代码的安全性,因此应将讨论的线程类型从讨论更改为问题.
as it doesn`t seem that you want to discuss your peace of code, you should change the type of your thread from discussion to question.
这篇关于如何跳过csv文件中的第一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!