如何跳过csv文件中的第一行 [英] how to skip the first line in csv file

查看:488
本文介绍了如何跳过csv文件中的第一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我有一个带标头的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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆